Re: [PATCH v2] pull: mention "pull", not "fetch" in the error message.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 28, 2010, 17:14 UTC
- Message-ID
- <7vmxxs4bd0.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1269615836-13995-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 28 quoted lines
> For newbies who've just been taught "git pull", the error message
> "Where do you want to fetch from today?" is indeed confusing. Change it
> to "Where do you want to pull from today?" in case fetch was called from
> pull.
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
> Just fixed a typo in commit message since v1.
>
> builtin/fetch.c | 6 +++++-
> git-pull.sh | 3 ++-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 957be9f..f3246f5 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -842,8 +842,12 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
> int ref_nr = 0;
> int exit_code;
>
> + char *cmd = getenv("GIT_USER_COMMAND");
> + if (cmd == NULL || cmd[0] == '\0')
> + cmd = "fetch";
> +
> if (!remote)
> - die("Where do you want to fetch from today?");
> + die("Where do you want to %s from today?", cmd);Show 13 quoted lines
> transport = transport_get(remote, NULL);
> transport_set_verbosity(transport, verbosity, progress);
> diff --git a/git-pull.sh b/git-pull.sh
> index 1a4729f..abc233b 100755
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -216,7 +216,8 @@ test true = "$rebase" && {
> done
> }
> orig_head=$(git rev-parse -q --verify HEAD)
> -git fetch $verbosity $progress --update-head-ok "$@" || exit 1
> +GIT_USER_COMMAND=pull \
> + git fetch $verbosity $progress --update-head-ok "$@" || exit 1I personally don't think this is a good change. When somebody writes a wrapper around "git pull" to "make it easier", the name of the command that is given in the message will still be "pull", and you will have exactly the same issue again.
It was never the intent of the use of word "fetch" in the original message to give the name of one among many commands (i.e. the message was not about "fetch vs pull"). The word was to convey more abstract concept of getting new changes that are available on the other end.
An alternative that does not introduce layering violation of making the lower level porcelain aware of what the caller is doing might be to make it even more bland, "Where do you want to get changes from today?", or something.
Or we could even make it even more explicit by saying "Where do you want to go today?", which was what the original meant to mock ;-).