Re: [PATCH/alternative/raw and rough] setup.c: denote repo wide pathspecs by ':'
- From
Phil Hord <hordp@cisco.com>
- Date
- Mar 1, 2011, 16:25 UTC
- Message-ID
- <4D6D1E07.1080109@cisco.com>
- In-Reply-To
- <7vsjv6evy4.fsf@alter.siamese.dyndns.org>
On 03/01/2011 09:50 AM, Junio C Hamano wrote:
Show 21 quoted lines
> The reason I am skeptical about the "from root prefix" is because I do not > see a way to make it compatible with other meaningful pathspecs. > > $ cd Documentation > $ git grep -e frotz '*.txt' > > would find frotz in all *.txt files in Documentation (and its > subdirectories), if the command takes "relatigve to cwd". > > It also is very clear that > > $ cd Documentation > $ git grep --full-tree -e frotz '*.txt' > > would find those anywhere, inside or outside Documentation. > > On the other hand, it is natural to expect that > > $ git grep -e frotz ".../*.txt" > > should find *.txt files _only_ at the root level, so it is not as
useful as
> the --full-tree (or --root).
I don't understand this last statement. I think it implies that it is also natural to expect that
$ git grep -e frotz -- "../*.txt"
should find *.txt files _only_ in the parent directory. But this is not the case. It returns the same search results as
$ ( cd .. ; git grep -e frotz -- "*.txt" )
Phil