Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-27 Thread Phil Hord
On Tue, Aug 27, 2013 at 12:07 AM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Not necessarily. If the user is asking the question in a more natural way (I want to see where in 'next' branch's tip commit hits appear, by the way, I know I am only interested

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Jonathan Nieder jrnie...@gmail.com writes: I think Phil meant that when git grep is asked to search within HEAD:some/path, filenames tacked on at the end should be appended with a '/' separator instead of the usual ':' (e.g.,

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Phil Hord
On Mon, Aug 26, 2013 at 3:14 AM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Jonathan Nieder jrnie...@gmail.com writes: I think Phil meant that when git grep is asked to search within HEAD:some/path, filenames tacked on at the end should be appended with

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Junio C Hamano
Phil Hord phil.h...@gmail.com writes: On Mon, Aug 26, 2013 at 3:14 AM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Jonathan Nieder jrnie...@gmail.com writes: I think Phil meant that when git grep is asked to search within HEAD:some/path, filenames

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Phil Hord
On Mon, Aug 26, 2013 at 12:23 PM, Junio C Hamano gits...@pobox.com wrote: Phil Hord phil.h...@gmail.com writes: On Mon, Aug 26, 2013 at 3:14 AM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Jonathan Nieder jrnie...@gmail.com writes: I think Phil meant

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: If your justification were above says 'there may be a readon why the user wanted to ask it in that way', i.e. 'find in this tree object HEAD:some/path and report where hits appear', but the reason can only be from laziness and/or broken script and the

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Phil Hord
On Mon, Aug 26, 2013 at 12:49 PM, Phil Hord phil.h...@gmail.com wrote: If so, then I would like to point out to you the convenience I accidentally encountered using this tool. Perhaps you didn't realize how helpful it was when you chose to use a colon there. My itch comes from a case where I

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Phil Hord
On Mon, Aug 26, 2013 at 1:03 PM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: If your justification were above says 'there may be a readon why the user wanted to ask it in that way', i.e. 'find in this tree object HEAD:some/path and report where hits

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Junio C Hamano
Phil Hord phil.h...@gmail.com writes: If your justification were above says 'there may be a readon why the user wanted to ask it in that way', i.e. 'find in this tree object HEAD:some/path and report where hits appear', but the reason can only be from laziness and/or broken script and the

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Phil Hord
On Mon, Aug 26, 2013 at 1:26 PM, Junio C Hamano gits...@pobox.com wrote: Phil Hord phil.h...@gmail.com writes: If your justification were above says 'there may be a readon why the user wanted to ask it in that way', i.e. 'find in this tree object HEAD:some/path and report where hits appear',

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-26 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Not necessarily. If the user is asking the question in a more natural way (I want to see where in 'next' branch's tip commit hits appear, by the way, I know I am only interested in builtin/ so I'd give pathspec as well when I am asking this question),

[RFC/PATCH] Fix path prefixing in grep_object

2013-08-24 Thread Phil Hord
When the pathspec given to grep includes a tree name, the full name of matched files is assembled using colon as a separator. If the pathspec includes a tree name, it should use a slash instead. Check if the pathspec already names a tree and ref (including a colon) and use a slash if so. --- I'm

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-24 Thread Phil Hord
On Sat, Aug 24, 2013 at 9:35 PM, Phil Hord ho...@cisco.com wrote: When the pathspec given to grep includes a tree name, the full name of matched files is assembled using colon as a separator. If the pathspec includes a tree name, it should use a slash instead. Check if the pathspec already

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-24 Thread Junio C Hamano
Phil Hord phil.h...@gmail.com writes: On Sat, Aug 24, 2013 at 9:35 PM, Phil Hord ho...@cisco.com wrote: When the pathspec given to grep includes a tree name, the full name of matched files is assembled using colon as a separator. If the pathspec includes a tree name, it should use a slash

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-24 Thread Jonathan Nieder
Junio C Hamano wrote: Phil Hord phil.h...@gmail.com writes: On Sat, Aug 24, 2013 at 9:35 PM, Phil Hord ho...@cisco.com wrote: When the pathspec given to grep includes a tree name, the full name of matched files is assembled using colon as a separator. If the pathspec includes a tree name, it

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-24 Thread Jeff King
On Sat, Aug 24, 2013 at 09:35:58PM -0400, Phil Hord wrote: When the pathspec given to grep includes a tree name, the full name of matched files is assembled using colon as a separator. If the pathspec includes a tree name, it should use a slash instead. Check if the pathspec already names

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-24 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: I think Phil meant that when git grep is asked to search within HEAD:some/path, filenames tacked on at the end should be appended with a '/' separator instead of the usual ':' (e.g., HEAD:some/path/inner/path.c, not HEAD:some/path:inner/path.c). Ah,

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-24 Thread Jonathan Nieder
Jeff King wrote: So we are necessarily reconstructing based on what we know of the syntax. And I think that your rule is OK, because we know that refnames cannot contain a colon. What happens with expressions like HEAD^{/test:}? Jonathan -- To unsubscribe from this list: send the line

Re: [RFC/PATCH] Fix path prefixing in grep_object

2013-08-24 Thread Jeff King
On Sat, Aug 24, 2013 at 10:41:42PM -0700, Jonathan Nieder wrote: Jeff King wrote: So we are necessarily reconstructing based on what we know of the syntax. And I think that your rule is OK, because we know that refnames cannot contain a colon. What happens with expressions like