From: cmn@elego.de (Carlos Martín Nieto)
To: Angelo Borsotti <angelo.borsotti@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: checkout extra files
Date: Tue, 04 Sep 2012 03:57:23 +0200 [thread overview]
Message-ID: <87txvev9bw.fsf@centaur.cmartin.tk> (raw)
In-Reply-To: <CAB9Jk9BjO+HdxhaGxEyaDoXgGisi0QpuVvsx3dZUnJV1VoKN1g@mail.gmail.com> (Angelo Borsotti's message of "Mon, 3 Sep 2012 17:10:15 +0200")
Keep it in the list.
Angelo Borsotti <angelo.borsotti@gmail.com> writes:
> Hi Carlos,
>>
>> That grouping is not what it's saying. It doesn't update the files that
>> exist in the working tree matching some glob. It updates the files in
>> the working tree from either the index or a treeish. The pathspec
>> refers, as always, to the data source, and '*' matches all files.
>>
>> It puts the named paths on to the working tree. Is that clearer?
>>
> This was mi first understanding, until one day I had in the working directory
> a file that matched the <path> (the path was '*') and that was NOT in the
> index or a treeish. The git checkout command tried to copy it and
> complained that there was no such file to restore.
So you're saying that you ran
git checkout <tree-ish> -- *
and git complained that there was no such file? This is because the
shell expanded the glob and gave git a list of files.
> Then I thought that it visited the working directory and tried to restore
> each file it matched and at the end restored also the ones that were not
> there.
I can't quite parse this. Git will restore whichever files you tell it
to. If you use an asterisk, then your shell will usually expand it. In
the case you posted to the list there were no files, so there was
nothing to expand it to. Some shells complain in this case by default,
some don't and just pass the asterisk to the program and let it figure
out what to do with it. This was the case in your example. You told git
to expand all the files it found in that tree-ish.
cmn
next prev parent reply other threads:[~2012-09-04 1:58 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 [this message]
2012-09-03 13:59 ` Nguyen Thai Ngoc Duy
2012-09-03 19:36 ` Junio C Hamano
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=87txvev9bw.fsf@centaur.cmartin.tk \
--to=cmn@elego.de \
--cc=angelo.borsotti@gmail.com \
--cc=git@vger.kernel.org \
/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).