git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH v2] pull: mention "pull", not "fetch" in the error message.
Date: Sat, 27 Mar 2010 09:52:23 +0100	[thread overview]
Message-ID: <vpqy6hep2ns.fsf@bauges.imag.fr> (raw)
In-Reply-To: <20100326231209.GB6797@blimp.localdomain> (Alex Riesen's message of "Sat\, 27 Mar 2010 00\:12\:10 +0100")

Alex Riesen <raa.lkml@gmail.com> writes:

> 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/

  reply	other threads:[~2010-03-27  8:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 13:38 [PATCH] pull: mention "pull", not "fetch" in the error message Matthieu Moy
2010-03-26 14:18 ` Michael J Gruber
2010-03-26 15:02   ` Matthieu Moy
2010-03-26 15:03   ` [PATCH v2] " Matthieu Moy
2010-03-26 23:12     ` Alex Riesen
2010-03-27  8:52       ` Matthieu Moy [this message]
2010-03-28 17:14     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqy6hep2ns.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=raa.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).