Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:48:30

Alex Riesen [off-list ref] writes:
Matthieu Moy, Fri, Mar 26, 2010 16:03:56 +0100:
quoted
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.
...
quoted
@@ -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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help