add commit --submit=false option

This commit is contained in:
Jeff Carr 2025-04-29 17:49:05 -05:00
parent 6d62858d69
commit f061bf9730
2 changed files with 8 additions and 1 deletions

View File

@ -17,7 +17,7 @@ var argv args
type args struct { type args struct {
Checkout *CheckoutCmd `arg:"subcommand:checkout" help:"switch branches using 'git checkout'"` Checkout *CheckoutCmd `arg:"subcommand:checkout" help:"switch branches using 'git checkout'"`
Clean *CleanCmd `arg:"subcommand:clean" help:"start over at the beginning"` Clean *CleanCmd `arg:"subcommand:clean" help:"start over at the beginning"`
Commit *EmptyCmd `arg:"subcommand:commit" help:"'git commit' but errors out if on wrong branch"` Commit *CommitCmd `arg:"subcommand:commit" help:"'git commit' but errors out if on wrong branch"`
Config *ConfigCmd `arg:"subcommand:config" help:"show your .config/forge/ settings"` Config *ConfigCmd `arg:"subcommand:config" help:"show your .config/forge/ settings"`
Dirty *DirtyCmd `arg:"subcommand:dirty" help:"show repos git says are dirty"` Dirty *DirtyCmd `arg:"subcommand:dirty" help:"show repos git says are dirty"`
GitFetch *FindCmd `arg:"subcommand:fetch" help:"run 'git fetch master'"` GitFetch *FindCmd `arg:"subcommand:fetch" help:"run 'git fetch master'"`
@ -40,6 +40,10 @@ type args struct {
type EmptyCmd struct { type EmptyCmd struct {
} }
type CommitCmd struct {
Submit bool `arg:"--submit" default:"true" help:"submit the patches to forge"`
}
type testCmd string type testCmd string
type CleanCmd struct { type CleanCmd struct {

View File

@ -24,6 +24,9 @@ func doCommit() {
} }
newpatches = true newpatches = true
} }
if !argv.Commit.Submit {
okExit("")
}
if newpatches { if newpatches {
// if there are enw patches, autocommit them // if there are enw patches, autocommit them
_, err := me.forge.SubmitDevelPatchSet("forge auto commit") _, err := me.forge.SubmitDevelPatchSet("forge auto commit")