git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] grep: use slash for path delimiter, not colon

From
Jeff King <peff@peff.net>
Date
Aug 26, 2013, 20:52 UTC
Message-ID
<20130826205215.GB23598@sigill.intra.peff.net>
In-Reply-To
<521BB6DA.5050807@kdbg.org>
On Mon, Aug 26, 2013 at 10:13:14PM +0200, Johannes Sixt wrote:
Show 12 quoted lines
> 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 note note this (it should be "HEAD:./RelNotes/1.5.1.5.txt"). I think this bug is orthogonal to Phil's patch, though.

-Peff
Previous: Phil HordNext: Phil Hord
Message 8 of 11 in “[PATCHv2] grep: use slash for path delimiter, not colon”
  1. Phil HordAug 26, 2013
  2. Jeff KingAug 26, 2013
  3. Jeff KingAug 26, 2013
  4. 1/2 grep: stop using object_arrayJeff King, Aug 26, 2013
  5. 2/2 grep: use slash for path delimiter, not colonJeff King, Aug 26, 2013
  6. Johannes SixtAug 26, 2013
  7. Phil HordAug 26, 2013
  8. Jeff KingAug 26, 2013
  9. Phil HordAug 26, 2013
  10. Jeff KingAug 26, 2013
  11. Junio C HamanoAug 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.