From: Junio C Hamano <gitster@pobox.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Angelo Borsotti <angelo.borsotti@gmail.com>, git@vger.kernel.org
Subject: Re: checkout extra files
Date: Mon, 03 Sep 2012 12:36:43 -0700 [thread overview]
Message-ID: <7vsjayew50.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CACsJy8A6-Ok34QDqgSVavFDBE81UdcK4rLzkHe7P7UO=fXptGw@mail.gmail.com> (Nguyen Thai Ngoc Duy's message of "Mon, 3 Sep 2012 20:59:21 +0700")
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> On Mon, Sep 3, 2012 at 8:42 PM, Angelo Borsotti
> <angelo.borsotti@gmail.com> wrote:
>> $ git checkout 94d8 -- *
>> $ ls
>> f1
>>
>> Note that the work directory is empty when the checkout is done, and
>> that the checkout restores f1
>> in it, a file that is not denoted by the * pathspec.
>
> I think in this case '*' remains unexpanded by the shell. Which means
> it is still a pathspec to checkout (iow equivalent to "git checkout
> 94d8 -- '*'"). Checkout in turns matches the pathspec '*' against the
> tree and decides to restore 'fl'.
>
> It's confusing but I don't think there's much we can do about it.
The user can, by telling the shell to expand '*' that does not match
to nothing, though.
Is there anything that is confusing in our documentation? I am not
looking for a change to the documentation that protects it from
getting misunderstood by deliberately twisted interpretations (such
a change would make the resulting text would harder to read), but I
do want to make sure it is not prone to confusion even to a casual
and careless reader.
For this particular scenario, I do not see anything offhand that is
unclear about the behaviour of Git in the documentation, even though
as you pointed out, if the user is unaware that the shell passes
globs unmodified when they do not match, it may lead to a confusion
like this. I certainly do not want to do a full "introduction to
shell" in our documentation, but if adding a short sentence or two
helps to avoid confusion like this, I do not strongly object to it.
next prev parent reply other threads:[~2012-09-03 19:36 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-03 13:42 checkout extra files Angelo Borsotti
2012-09-03 13:55 ` Carlos Martín Nieto
[not found] ` <CAB9Jk9AkFW-fAqOZuhCMgMBdEZwDpe5ZG9Dkse=Wz_x9LvJEPw@mail.gmail.com>
2012-09-03 14:47 ` Carlos Martín Nieto
[not found] ` <CAB9Jk9BjO+HdxhaGxEyaDoXgGisi0QpuVvsx3dZUnJV1VoKN1g@mail.gmail.com>
2012-09-04 1:57 ` Carlos Martín Nieto
2012-09-03 13:59 ` Nguyen Thai Ngoc Duy
2012-09-03 19:36 ` Junio C Hamano [this message]
2012-09-04 1:49 ` Nguyen Thai Ngoc Duy
2012-09-04 2:55 ` Junio C Hamano
2012-09-04 7:15 ` Angelo Borsotti
2012-09-04 8:53 ` Junio C Hamano
2012-09-04 14:30 ` Junio C Hamano
2012-09-04 16:15 ` Junio C Hamano
2012-09-07 20:49 ` Junio C Hamano
[not found] ` <CAB9Jk9BtZzgi32kxVTbGC7eAjFG41bdae=MaK==sKq=9ohf8_w@mail.gmail.com>
2012-09-08 18:54 ` Junio C Hamano
2012-09-10 0:24 ` Junio C Hamano
2012-09-08 20:40 ` Philip Oakley
2012-09-09 3:31 ` Junio C Hamano
2012-09-09 13:48 ` Matthieu Moy
2012-09-09 18:23 ` Junio C Hamano
2012-09-09 23:25 ` Philip Oakley
2012-09-10 16:19 ` Jeff King
2012-09-10 17:09 ` Junio C Hamano
2012-09-10 17:19 ` Jeff King
2012-09-10 19:35 ` Junio C Hamano
2012-09-10 19:53 ` [PATCH 1/2] gitcli: formatting fix Junio C Hamano
2012-09-10 19:54 ` [PATCH 2/2] gitcli: contrast wildcard given to shell and to git Junio C Hamano
2012-09-10 20:11 ` checkout extra files Jeff King
2012-09-10 20:34 ` Junio C Hamano
2012-09-04 10:14 ` Nguyen Thai Ngoc Duy
[not found] ` <CAB9Jk9CNYr6LfWvyVqXvHjh7dzhUAuzkufqO9YMeOXg08D2cJw@mail.gmail.com>
[not found] ` <CACsJy8AUYigHVKjzE-0NT0hnOrQWdufN+COmkk=2Q8L1Rimytw@mail.gmail.com>
2012-09-04 13:24 ` Angelo Borsotti
2012-09-04 16:49 ` Junio C Hamano
2012-09-04 19:29 ` Angelo Borsotti
2012-09-04 20:44 ` Junio C Hamano
2012-09-04 22:53 ` Philip Oakley
2012-09-04 23:31 ` Junio C Hamano
2012-09-04 15:31 ` 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=7vsjayew50.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=angelo.borsotti@gmail.com \
--cc=git@vger.kernel.org \
--cc=pclouds@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).