forge/applyPatch.go

49 lines
1.5 KiB
Go

// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
/*
// saves the patches in ~/.config/forge/currentpatches/
func savePatchset(pset *forgepb.Patchset) error {
log.Info("savePatches() NAME", pset.Name)
log.Info("savePatches() COMMENT", pset.Comment)
log.Info("savePatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName())
log.Info("savePatches() GIT_AUTHOR_EMAIL", pset.GetGitAuthorEmail())
log.Info("savePatches() Branch Name", pset.GetStartBranchName())
log.Info("savePatches() Start Hash", pset.GetStartBranchHash())
}
*/
/*
// From 18ee541f89be2e9f9a91c54873da87885e8ffdf5 Mon Sep 17 00:00:00 2001
// From: Jeff Carr <jcarr@wit.com>
// Date: Sun, 5 Jan 2025 01:18:47 -0600
// Subject: [PATCH] 'forge dirty' will find and list only dirty repos
// list patches in jcarr but not in devel
// git log --format="%H %Subject" jcarr --not devel
func countCurrentPatches(repo *gitpb.Repo) int {
cmd := []string{"git", "log", "--format=\"%H %s\"", "--no-merges", "jcarr", "--not", "devel"}
result := repo.Run(cmd)
return len(result.Stdout)
}
func doRegister(newurl string) error {
var url string
url = me.urlbase + "/register?url=" + newurl
body, err := me.forge.HttpPost(url, nil)
if err != nil {
log.Info("httpPost() failed:", err)
return err
}
test := strings.TrimSpace(string(body))
for _, line := range strings.Split(test, "\n") {
line = strings.TrimSpace(line)
log.Info("server returned:", line)
}
return nil
}
*/