Re: Confusing git pull error message
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:24
Jeff King [off-list ref] writes:
quoted
I think saying "does not exist" will repeat the same mistake of overguessing you are trying to rectify.You are right, of course. I think your wording makes sense, then (otherwise we get stuck with "well, we didn't fetch it. Maybe because it didn't exist. Or maybe because your configuration didn't include it.").
Yeah, the saddest part of this whole story is that the message given by
the very original was succinct and accurate.
echo >&2 "Warning: No merge candidate found because value of config option
\"branch.${curr_branch}.merge\" does not match any remote branch fetched."
echo >&2 "No changes."
Then we piled up different messages for various cases, and it went
downhill from there.
- First, 8fc293c (Make git-pull complain and give advice when there is
nothing to merge with, 2007-10-02) made the message say essentially the
same thing, but with a lot more verbosity, covering only one _common_
case.
- Then 441ed41 ("git pull --tags": error out with a better message.,
2007-12-28) added a special case for --tags. The description before
8fc293c would have still been correct without this change. This was
necessary because 8fc293c talked only about the "I am on branch and
there is no configuration" case.
- Then 61e6108 (git-pull.sh: better warning message for "git pull" on
detached head., 2009-04-08) added another special case, again because
the "helpful" instruction given by 8fc293c did not make any sense in
the detached HEAD case.
It definitely is worth to further cover cases the message by 8fc293c did
not consider, as this thread suggested, but at the same time, I think the
advice mechanism should be used to bring back a succinct and to-the-point
message, close to the original one, e.g.
Warning: Not merging anything, as no default merge candidate ref
was fetched from the remote.
so that people who know what they are doing can squelch potentially
misleading "helpful" advices and diagnose/think for their own.