@@ -73,18 +73,18 @@ type prDecision struct {
7373 // pushAnyway is true when action is prActionSkip but a descendant branch
7474 // will get a PR, so the branch must still exist on the remote as a base.
7575 pushAnyway bool
76- // skipReason is set when action is prActionSkip ("update-only " or "user").
76+ // skipReason is set when action is prActionSkip ("update" or "user").
7777 skipReason string
7878}
7979
8080func init () {
81- submitCmd .Flags ().BoolVar (& submitDryRunFlag , "dry-run" , false , "show what would be done without doing it" )
82- submitCmd .Flags ().BoolVar (& submitCurrentOnlyFlag , "current-only " , false , "only submit current branch, not descendants" )
83- submitCmd .Flags ().BoolVar (& submitUpdateOnlyFlag , "update-only " , false , "only update existing PRs, don't create new ones" )
84- submitCmd .Flags ().BoolVar (& submitPushOnlyFlag , "push-only " , false , "skip PR creation/update, only restack and push" )
81+ submitCmd .Flags ().BoolVarP (& submitDryRunFlag , "dry-run" , "D " , false , "show what would be done without doing it" )
82+ submitCmd .Flags ().BoolVarP (& submitCurrentOnlyFlag , "current" , "c " , false , "only submit current branch, not descendants" )
83+ submitCmd .Flags ().BoolVarP (& submitUpdateOnlyFlag , "update" , "u " , false , "only update existing PRs, don't create new ones" )
84+ submitCmd .Flags ().BoolVarP (& submitPushOnlyFlag , "skip-prs" , "s " , false , "skip PR creation/update, only restack and push" )
8585 submitCmd .Flags ().BoolVarP (& submitYesFlag , "yes" , "y" , false , "skip interactive prompts and use auto-generated title/description for PRs" )
86- submitCmd .Flags ().BoolVarP (& submitWebFlag , "web" , "w " , false , "open created/updated PRs in web browser" )
87- submitCmd .Flags ().StringVar (& submitFromFlag , "from" , "" , "submit from this branch toward leaves (default: entire stack; bare --from = current branch)" )
86+ submitCmd .Flags ().BoolVar (& submitWebFlag , "web" , false , "open created/updated PRs in web browser" )
87+ submitCmd .Flags ().StringVarP (& submitFromFlag , "from" , "f " , "" , "submit from this branch toward leaves (default: entire stack; bare --from = current branch)" )
8888 submitCmd .Flags ().Lookup ("from" ).NoOptDefVal = "HEAD"
8989 rootCmd .AddCommand (submitCmd )
9090}
@@ -94,13 +94,13 @@ func runSubmit(cmd *cobra.Command, args []string) error {
9494
9595 // Validate flag combinations
9696 if submitPushOnlyFlag && submitUpdateOnlyFlag {
97- return errors .New ("--push-only and --update-only cannot be used together: --push-only skips all PR operations" )
97+ return errors .New ("--skip-prs and --update cannot be used together: --skip-prs skips all PR operations" )
9898 }
9999 if submitPushOnlyFlag && submitWebFlag {
100- return errors .New ("--push-only and --web cannot be used together: --push-only skips all PR operations" )
100+ return errors .New ("--skip-prs and --web cannot be used together: --skip-prs skips all PR operations" )
101101 }
102102 if submitFromFlag != "" && submitCurrentOnlyFlag {
103- return errors .New ("--from and --current-only cannot be used together" )
103+ return errors .New ("--from and --current cannot be used together: --current limits the scope to the current branch " )
104104 }
105105
106106 cwd , err := os .Getwd ()
@@ -138,15 +138,15 @@ func runSubmit(cmd *cobra.Command, args []string) error {
138138
139139 // Collect branches to submit.
140140 //
141- // --current-only : only the current branch (no descendants, no ancestors).
141+ // --current: only the current branch (no descendants, no ancestors).
142142 // --from (bare): current branch + descendants (old default behavior).
143143 // --from=<branch>: that branch + descendants.
144144 // Default: entire stack (all trunk descendants).
145145 var branches []* tree.Node
146146 if submitCurrentOnlyFlag {
147- // --current-only : submit only the current checked-out branch
147+ // --current: submit only the current checked-out branch
148148 if currentBranch == trunk {
149- return fmt .Errorf ("cannot submit trunk branch %q; switch to a stack branch or remove --current-only " , trunk )
149+ return fmt .Errorf ("cannot submit trunk branch %q; switch to a stack branch or remove --current" , trunk )
150150 }
151151 node := tree .FindNode (root , currentBranch )
152152 if node == nil {
@@ -280,7 +280,7 @@ func doSubmitPushAndPR(g *git.Git, cfg *config.Config, root *tree.Node, branches
280280 decisionByName [d .node .Name ] = d
281281 }
282282
283- // Phase 2: Push branches that will participate in PRs (or all if --push-only ).
283+ // Phase 2: Push branches that will participate in PRs (or all if --skip-prs ).
284284 fmt .Println (s .Bold ("\n === Phase 2: Push ===" ))
285285 for _ , b := range branches {
286286 var d * prDecision
@@ -306,7 +306,7 @@ func doSubmitPushAndPR(g *git.Git, cfg *config.Config, root *tree.Node, branches
306306
307307 if opts .PushOnly {
308308 fmt .Println (s .Bold ("\n === Phase 3: PRs ===" ))
309- fmt .Println (s .Muted ("Skipped (--push-only )" ))
309+ fmt .Println (s .Muted ("Skipped (--skip-prs )" ))
310310 return nil
311311 }
312312 return executePRDecisions (g , cfg , root , decisions , ghClient , opts , s )
@@ -326,7 +326,7 @@ func planPRDecisions(g *git.Git, cfg *config.Config, ghClient *github.Client, tr
326326 case existingPR > 0 :
327327 out = append (out , & prDecision {node : b , parent : parent , action : prActionUpdate , prNum : existingPR })
328328 case updateOnly :
329- out = append (out , & prDecision {node : b , parent : parent , action : prActionSkip , skipReason : "update-only " })
329+ out = append (out , & prDecision {node : b , parent : parent , action : prActionSkip , skipReason : "update" })
330330 case dryRun :
331331 out = append (out , planPRDecisionDryRun (g , b , parent , trunk , s ))
332332 default :
@@ -447,14 +447,14 @@ func executePRDecisions(g *git.Git, cfg *config.Config, root *tree.Node, decisio
447447 switch d .action {
448448 case prActionSkip :
449449 if opts .DryRun {
450- if d .skipReason == "update-only " {
451- fmt .Printf ("Skipping %s %s\n " , s .Branch (b .Name ), s .Muted ("(no existing PR, --update-only )" ))
450+ if d .skipReason == "update" {
451+ fmt .Printf ("Skipping %s %s\n " , s .Branch (b .Name ), s .Muted ("(no existing PR, --update)" ))
452452 }
453453 continue
454454 }
455455 switch d .skipReason {
456- case "update-only " :
457- fmt .Printf ("Skipping %s %s\n " , s .Branch (b .Name ), s .Muted ("(no existing PR, --update-only )" ))
456+ case "update" :
457+ fmt .Printf ("Skipping %s %s\n " , s .Branch (b .Name ), s .Muted ("(no existing PR, --update)" ))
458458 case "user" :
459459 fmt .Printf ("Skipped PR for %s %s\n " , s .Branch (b .Name ), s .Muted ("(skipped)" ))
460460 }
0 commit comments