Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-02-14 Thread Stefan Hajnoczi
On Thu, Feb 09, 2017 at 12:20:34AM -0500, Jeff King wrote: > On Wed, Feb 08, 2017 at 09:14:17PM -0800, Junio C Hamano wrote: > > Jeff King writes: > (I _do_ think Stefan's proposed direction is worth it simply because the > result is easier to read, but I agree the whole thing can

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-02-08 Thread Jeff King
On Wed, Feb 08, 2017 at 09:14:17PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > master:a:a:a:a:a:a:a:a:a:a:a > > > > I think there are 2^(n-1) possible paths (each colon can be a real colon > > or a slash). Though I guess if you walk the trees as you go, you only > >

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-02-08 Thread Junio C Hamano
Jeff King writes: > master:a:a:a:a:a:a:a:a:a:a:a > > I think there are 2^(n-1) possible paths (each colon can be a real colon > or a slash). Though I guess if you walk the trees as you go, you only > have to examine at most "n" paths to find the first-level tree, and then > at

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-02-08 Thread Jeff King
On Tue, Feb 07, 2017 at 12:24:30PM -0800, Junio C Hamano wrote: > Having said that, I actually think "make it more convenient" without > making anything incorrect would be to teach the revision parser to > understand > > > as an extended SHA-1

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-02-07 Thread Junio C Hamano
Junio C Hamano writes: Sorry, one shouldn't type while being sick and in bed X-<. > I am not sure if you are shooting for is "work correctly" to begin > with, to be honest. The current code always shows the "correct" > output which is "the tree-ish object name (expressed in

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-02-07 Thread Junio C Hamano
Stefan Hajnoczi writes: > Perhaps it's better to leave this than to merge code that doesn't work > correctly 100% of the time. I am not sure if you are shooting for is "work correctly" to begin with, to be honest. The current code always shows the "correct" output which is

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-02-07 Thread Jeff King
On Tue, Feb 07, 2017 at 03:04:14PM +, Stefan Hajnoczi wrote: > > I assume Stefan just grabbed my naive suggestion hence why it checks > > equality with a commit. So that's my fault :) Either of these may > > not be enough though, since if you do 'git grep malloc v2.9.3^{tree}' > > with this

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-02-07 Thread Stefan Hajnoczi
On Fri, Jan 20, 2017 at 03:51:33PM -0800, Brandon Williams wrote: > On 01/20, Junio C Hamano wrote: > > Stefan Hajnoczi writes: > > > > > If the tree contains a sub-directory then git-grep(1) output contains a > > > colon character instead of a path separator: > > > > > >

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-01-20 Thread Brandon Williams
On 01/20, Junio C Hamano wrote: > Stefan Hajnoczi writes: > > > If the tree contains a sub-directory then git-grep(1) output contains a > > colon character instead of a path separator: > > > > $ git grep malloc v2.9.3:t > > v2.9.3:t:test-lib.sh: setup_malloc_check ()

Re: [PATCH v2 2/2] grep: use '/' delimiter for paths

2017-01-20 Thread Junio C Hamano
Stefan Hajnoczi writes: > If the tree contains a sub-directory then git-grep(1) output contains a > colon character instead of a path separator: > > $ git grep malloc v2.9.3:t > v2.9.3:t:test-lib.sh: setup_malloc_check () { > $ git show v2.9.3:t:test-lib.sh >

[PATCH v2 2/2] grep: use '/' delimiter for paths

2017-01-20 Thread Stefan Hajnoczi
If the tree contains a sub-directory then git-grep(1) output contains a colon character instead of a path separator: $ git grep malloc v2.9.3:t v2.9.3:t:test-lib.sh: setup_malloc_check () { $ git show v2.9.3:t:test-lib.sh fatal: Path 't:test-lib.sh' does not exist in 'v2.9.3' This patch