Re: Relative ls-files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 23, 2011, 15:24 UTC
- Message-ID
- <7vy645g8qk.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <AANLkTinGedXLX_rZTtx6CeDonQ0dbsN2BBSqPcs258Yg@mail.gmail.com>
Martin Langhoff <martin.langhoff@gmail.com> writes:
Show 6 quoted lines
> On Wed, Mar 23, 2011 at 10:09 AM, Junio C Hamano <gitster@pobox.com> wrote: >> Because --with-tree nor ls-files is the tool that was designed for. >> >> If you want to find out about a branch, why aren't you using "ls-tree -r"? > > Thanks! Tab-completion wasn't showing it, so I never saw it.
Going back to your original (which I suspect may be different from John Tapsell's original):
- is this file in branch foo? - has this file moved in branch foo? - what files with extension .zoo exist in branch foo?
I am not sure what the difference between the first two question, but the most direct way the scripted Porcelains do to answer these questions is:
git rev-parse --verify "foo:$the_path"
The third question can be answered by listing paths in branch 'foo' and looking for .zoo, like so:
git ls-tree -r --name-only --full-tree foo | grep '\.zoo$'