From: Junio C Hamano Date: Wed, 23 Mar 2011 15:24:51 GMT Subject: Re: Relative ls-files Message-ID: <7vy645g8qk.fsf@alter.siamese.dyndns.org> In-Reply-To: Martin Langhoff writes: > On Wed, Mar 23, 2011 at 10:09 AM, Junio C Hamano 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$'