Re: [PATCH 2/2] grep: use slash for path delimiter, not colon
- From
Phil Hord <phil.hord@gmail.com>
- Date
- Aug 26, 2013, 21:03 UTC
- Message-ID
- <CABURp0pPzRH5JdPEooyZw0iccD891E1i_CbTqDfVJnx+drfQEw@mail.gmail.com>
- In-Reply-To
- <20130826205215.GB23598@sigill.intra.peff.net>
On Mon, Aug 26, 2013 at 4:52 PM, Jeff King <peff@peff.net> wrote:
Show 32 quoted lines
> On Mon, Aug 26, 2013 at 10:13:14PM +0200, Johannes Sixt wrote: > >> Am 26.08.2013 21:56, schrieb Jeff King: >> > Also, prevent the delimiter being added twice, as happens now in these >> > examples: >> > >> > git grep -l foo HEAD: >> > HEAD::some/path/to/foo.txt >> > ^ >> >> Which one of these two does it print then? >> >> HEAD:/some/path/to/foo.txt >> HEAD:some/path/to/foo.txt > > It should (and does) print the latter. > > But I do note that our pathspec handling for subdirectories seems buggy. > If you do: > > $ cd Documentation > $ git grep -l foo | head -1 > RelNotes/1.5.1.5.txt > > that's fine; we limit to the current directory. But then if you do: > > $ git grep -l foo HEAD | head -1 > HEAD:RelNotes/1.5.1.5.txt > > we still limit to the current directory, but the output does not note > this (it should be "HEAD:./RelNotes/1.5.1.5.txt"). I think this bug is > orthogonal to Phil's patch, though.
Maybe not. My path completes the assumption that the L:R value returned by grep is an object ref; but Junio still thought it wasn't. I think this is another case where his view was correct.
There's more bad news on this front.
$ cd Documentation
$ git grep -l foo HEAD .. | head -1
HEAD:../.gitignoreThat's not a valid ref, either (though maybe it could be).
Phil