Commit 478bd0c00c

478bd0c00c75e518bac97ce806670bf17e8a177b

parent: 6a1ce6c2c8

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-12 05:04 UTC

control: merge refusals name the strategy, not the flag

The same text reaches the web merge form, which has no flags.

Ref #182
internal/control/mr.go +3 −3
@@ -1054,7 +1054,7 @@ func runMRMerge(c *Ctx, args []string) int {
10541054 case "ff":
10551055 if !ffPossible {
10561056 return c.fail(protocol.ExitUsage,
1057 "fast-forward not possible: %s has diverged from the MR head; use --strategy merge or rebase and re-push", mr.TargetRef)
1057 "fast-forward not possible: %s has diverged from the MR head; merge with the merge strategy, or rebase and push again", mr.TargetRef)
10581058 }
10591059 newSHA = headSHA
10601060
@@ -1129,7 +1129,7 @@ func runMRMerge(c *Ctx, args []string) int {
11291129 }
11301130 if len(parents) > 1 {
11311131 return c.fail(protocol.ExitUsage,
1132 "the MR contains merge commit %.10s; a rebase merge needs linear history — use --strategy merge or squash", sha)
1132 "the MR contains merge commit %.10s; a rebase merge needs linear history — choose the merge or squash strategy", sha)
11331133 }
11341134 base := onto // root commit: replay against the new tip itself
11351135 if len(parents) == 1 {
@@ -1175,7 +1175,7 @@ func runMRMerge(c *Ctx, args []string) int {
11751175 nums = append(nums, fmt.Sprintf("!%d", k.Number))
11761176 }
11771177 return c.fail(protocol.ExitUsage,
1178 "%s is stacked on by %s; a %s merge rewrites the commits they build on. Merge with --strategy ff or merge, or merge the stack into %s first",
1178 "%s is stacked on by %s; a %s merge rewrites the commits they build on. Merge with the fast-forward or merge strategy, or merge the stack into %s first",
11791179 fmt.Sprintf("!%d", mr.Number), strings.Join(nums, ", "), strategy, mr.SourceRef)
11801180 }
11811181