set a Name for the patchset

This commit is contained in:
Jeff Carr 2024-12-24 03:35:19 -06:00
parent 3505a66d84
commit 55e7e11a4c
6 changed files with 21 additions and 30 deletions

View File

@ -1,8 +1,8 @@
VERSION = $(shell git describe --tags) VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d) BUILDTIME = $(shell date +%Y.%m.%d)
info: info: install
make dirty # make dirty
@echo "make restart # remove the repos.pb file" @echo "make restart # remove the repos.pb file"
@echo "make private # only the private ones" @echo "make private # only the private ones"
@echo "make mine # just show my repos" @echo "make mine # just show my repos"

14
argv.go
View File

@ -15,19 +15,19 @@ type FindCmd struct {
} }
type DoCmd struct { type DoCmd struct {
List bool `arg:"--list" help:"just show a table of the current state"` List bool `arg:"--list" help:"just show a table of the current state"`
GitPull bool `arg:"--pull" help:"run 'git pull'"` GitPull bool `arg:"--pull" help:"run 'git pull'"`
GitReset bool `arg:"--git-reset" help:"run 'git reset --hard'"` GitReset bool `arg:"--git-reset" help:"run 'git reset --hard'"`
Scan bool `arg:"--scan" help:"reload protobuf from .git/"` Scan bool `arg:"--scan" help:"reload protobuf from .git/"`
Force bool `arg:"--force" help:"force redo things"` Force bool `arg:"--force" help:"force redo things"`
Dirty bool `arg:"--dirty" help:"update git CheckDirty()"` Dirty bool `arg:"--dirty" help:"update git CheckDirty()"`
PatchSet string `arg:"--patchset" help:"make patch set"`
} }
type args struct { type args struct {
Find *FindCmd `arg:"subcommand:find" help:"select repos (for example, --all or --mine)"` Find *FindCmd `arg:"subcommand:find" help:"select repos (for example, --all or --mine)"`
Do *DoCmd `arg:"subcommand:do" help:"do something ('git pull', 'build', 'install', etc)"` Do *DoCmd `arg:"subcommand:do" help:"do something ('git pull', 'build', 'install', etc)"`
Config bool `arg:"--config" help:"show your .config/forge/ settings"` Config bool `arg:"--config" help:"show your .config/forge/ settings"`
DoPatchSet bool `arg:"--make-patchset" help:"make patch set"`
ListPatchSet bool `arg:"--list-patchset" help:"list patch sets"` ListPatchSet bool `arg:"--list-patchset" help:"list patch sets"`
DryRun bool `arg:"--dry-run" help:"show what would be run"` DryRun bool `arg:"--dry-run" help:"show what would be run"`
Fix bool `arg:"--fix" help:"fix config, save config & exit"` Fix bool `arg:"--fix" help:"fix config, save config & exit"`

View File

@ -54,7 +54,7 @@ func doCheckDirty() {
} }
} }
} }
doCobol() // doCobol()
log.Info("dirty check took:", shell.FormatDuration(time.Since(now))) log.Info("dirty check took:", shell.FormatDuration(time.Since(now)))
me.forge.SetConfigSave(configSave) me.forge.SetConfigSave(configSave)
} }

14
main.go
View File

@ -32,6 +32,9 @@ func main() {
me = new(mainType) me = new(mainType)
me.pp = arg.MustParse(&argv) me.pp = arg.MustParse(&argv)
me.urlbase = argv.URL me.urlbase = argv.URL
if me.urlbase == "" {
me.urlbase = "https://go.wit.com/"
}
me.urlbase = strings.Trim(me.urlbase, "/") // track down why trailing '/' makes http POST not work me.urlbase = strings.Trim(me.urlbase, "/") // track down why trailing '/' makes http POST not work
// load the ~/.config/forge/ config // load the ~/.config/forge/ config
@ -108,12 +111,11 @@ func main() {
doCobol() doCobol()
done = true done = true
} }
} if argv.Do.PatchSet != "" {
sendDevelDiff(argv.Do.PatchSet)
if argv.DoPatchSet { // sendMasterDiff()
sendDevelDiff() okExit("patches")
// sendMasterDiff() }
okExit("patches")
} }
if argv.ListPatchSet { if argv.ListPatchSet {

15
send.go
View File

@ -80,26 +80,15 @@ func getPatch(pbfile string) error {
return nil return nil
} }
func sendDevelDiff() { func sendDevelDiff(name string) {
pset, err := me.forge.MakeDevelPatchSet() pset, err := me.forge.MakeDevelPatchSet()
if err != nil { if err != nil {
badExit(err) badExit(err)
} }
pset.Name = name
if err := sendPatches(pset); err != nil { if err := sendPatches(pset); err != nil {
badExit(err) badExit(err)
} }
/*
all := pset.SortByFilename()
for all.Scan() {
p := all.Next()
log.Info("read in patch:", p.Filename)
}
err = me.forge.SendPatchSet(pset)
if err != nil {
badExit(err)
}
*/
} }
func sendMasterDiff() { func sendMasterDiff() {

View File

@ -157,7 +157,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
} }
} }
s.submitB = s.grid.NewButton("Submit", func() { s.submitB = s.grid.NewButton("Submit", func() {
sendDevelDiff() sendDevelDiff(s.reason.String())
/* /*
dirname := "submit-patchset.quilt" dirname := "submit-patchset.quilt"
patchdir := filepath.Join(me.userHomePwd.String(), dirname) patchdir := filepath.Join(me.userHomePwd.String(), dirname)