git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pull: mention "pull", not "fetch" in the error message.

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 26, 2010, 14:18 UTC
Message-ID
<4BACC241.4010608@drmicha.warpmail.net>
In-Reply-To
<1269610699-13176-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy venit, vidit, dixit 26.03.2010 14:38:
> For newbies who've just been taught "git push", the error message

Even though newbies don't read git.git's commit messages, you may want to say "pull" here ;)

One way or the other, nothing beats the error messages in ident.c ;)
Show 42 quoted lines
> "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>
> ---
>  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);
>  
>  	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 1
>  
>  curr_head=$(git rev-parse -q --verify HEAD)
>  if test -n "$orig_head" && test "$curr_head" != "$orig_head"
Previous: Matthieu MoyNext: Matthieu Moy
Message 2 of 7 in “pull: mention "pull", not "fetch" in the error message.”
  1. pull: mention "pull", not "fetch" in the error message.Matthieu Moy, Mar 26, 2010
  2. Michael J GruberMar 26, 2010
  3. Matthieu MoyMar 26, 2010
  4. pull: mention "pull", not "fetch" in the error message.Matthieu Moy, Mar 26, 2010
  5. Alex RiesenMar 26, 2010
  6. Matthieu MoyMar 27, 2010
  7. Junio C HamanoMar 28, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.