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

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

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Mar 27, 2010, 08:52 UTC
Message-ID
<vpqy6hep2ns.fsf@bauges.imag.fr>
In-Reply-To
<20100326231209.GB6797@blimp.localdomain>
Alex Riesen <raa.lkml@gmail.com> writes:
Show 14 quoted lines
> Matthieu Moy, Fri, Mar 26, 2010 16:03:56 +0100:
>> 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.
> ...
>> @@ -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");
>
> Isn't the variable name a little too generic? USER_COMMAND doesn't make it
> clear that its only purpose is to pass a string "pull"

It is generic, so that the same variable can be reused elsewhere if needed. When a command "git foo" calls internally "git bar", the instance of "git bar" thinks it's executing the command "bar", but the user thinks he just ran the command "foo". This variable lets git know that and adapt its error message accordingly.

> to an error message which is never even seen under normal
> circumstances.

For some definition of "never ever" and/or "normal circumstances" only, then:

/tmp/test$ git init Initialized empty Git repository in /tmp/test/.git/ /tmp/test$ git pull fatal: Where do you want to pull from today?

(the confused newbie scenario isn't imaginary, it just happened to a colleague of mine)

-- Matthieu Moy http://www-verimag.imag.fr/~moy/

Previous: Alex RiesenNext: Junio C Hamano
Message 6 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.