Thread (48 messages) 48 messages, 3 authors, 2021-07-06

Re: [RFC PATCH 01/35] merge: improve fatal fast-forward message

From: Felipe Contreras <hidden>
Date: 2021-07-06 20:39:59

Ævar Arnfjörð Bjarmason wrote:
On Mon, Jul 05 2021, Felipe Contreras wrote:
quoted
Signed-off-by: Felipe Contreras <redacted>
---
 builtin/merge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/merge.c b/builtin/merge.c
index a8a843b1f5..05e631229d 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1620,7 +1620,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	}
 
 	if (fast_forward == FF_ONLY)
-		die(_("Not possible to fast-forward, aborting."));
+		die(_("unable to fast-forward"));
I read the existing message a bit more like "this makes no sense
anymore" (correct) and the latter more like "we encountered an
error".
I mean, this is the documentation of --ff-only:

  With `--ff-only`, resolve the merge as a fast-forward when possible.
  When not possible, refuse to merge and exit with a non-zero status.

So if you do `git merge --ff-only` you are telling git: "I want you to
exit with an error when the fast-forward is not possible".

If you do:

  % git merge --ff-only
  fatal: Not possible to fast-forward, aborting.

That "aborting" part is redundant; we know `git merge` should abort if
the fast-forward is not possible, we explicitely told git to do that.

Moreover the "fatal: " prefix also indicates that git aborted.

Then you have "Not possible to fast-forward", which if memory serves
well should be in lowercase (altghough can't find that in the
guidelines).

"unable to fast-forward" is simply a more succinct way of saying
"not possible to fast-forward". Sure, we are not explaining why,
although I can't think of any other reason why we could not fast-forward.
Perhaps something like:

    "Can't merge X with Y, in --ff-only mode, would need to create a merge commit", tip_name
I don't think die() messages should be that big, how about?

  branches diverged, can't fast-forward

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help