[PATCH v2 0/2] Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-10 Thread Nguyễn Thái Ngọc Duy
Round too. .gitattributes should be respected in all cases except blob grepping. As Johannes pointed elsewhere in this thread, if "git diff " looks up worktree's .gitattributes (and none in rev1/rev2), there's no reason "git grep" should behave differently. Nguyễn Thái Ngọc Duy (2): quote: let

Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-10 Thread Nguyễn Thái Ngọc Duy
On Wed, Oct 10, 2012 at 1:59 AM, Junio C Hamano wrote: > Jeff King writes: > >> I think we just need to have callers of grep_source_init provide us with >> the actual pathname (or NULL, in the case of GREP_SOURCE_BUF). That is >> where the information is lost. > > Yes. I agree that is the right

Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-09 Thread Nguyen Thai Ngoc Duy
On Wed, Oct 10, 2012 at 12:33 PM, Junio C Hamano wrote: > Nguyen Thai Ngoc Duy writes: > >> On Wed, Oct 10, 2012 at 1:59 AM, Junio C Hamano wrote: >>> Jeff King writes: >>> I think we just need to have callers of grep_source_init provide us with the actual pathname (or NULL, in the ca

Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-09 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > On Wed, Oct 10, 2012 at 1:59 AM, Junio C Hamano wrote: >> Jeff King writes: >> >>> I think we just need to have callers of grep_source_init provide us with >>> the actual pathname (or NULL, in the case of GREP_SOURCE_BUF). That is >>> where the information is lost

Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-09 Thread Nguyen Thai Ngoc Duy
On Wed, Oct 10, 2012 at 1:59 AM, Junio C Hamano wrote: > Jeff King writes: > >> I think we just need to have callers of grep_source_init provide us with >> the actual pathname (or NULL, in the case of GREP_SOURCE_BUF). That is >> where the information is lost. > > Yes. I agree that is the right

Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-09 Thread Junio C Hamano
Jeff King writes: > I think we just need to have callers of grep_source_init provide us with > the actual pathname (or NULL, in the case of GREP_SOURCE_BUF). That is > where the information is lost. Yes. I agree that is the right approach. -- To unsubscribe from this list: send the line "unsubs

Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-09 Thread Jeff King
On Tue, Oct 09, 2012 at 07:01:44PM +0700, Nguyen Thai Ngoc Duy wrote: > On Tue, Oct 09, 2012 at 04:38:32PM +0700, Nguyen Thai Ngoc Duy wrote: > > #5 0x0815e736 in userdiff_find_by_path (path=0x820e7f0 > > "HEAD:Documentation/.gitattributes") at userdiff.c:278 > > #6 0x081058ca in grep_source_loa

Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-09 Thread Nguyen Thai Ngoc Duy
On Tue, Oct 09, 2012 at 04:38:32PM +0700, Nguyen Thai Ngoc Duy wrote: > #5 0x0815e736 in userdiff_find_by_path (path=0x820e7f0 > "HEAD:Documentation/.gitattributes") at userdiff.c:278 > #6 0x081058ca in grep_source_load_driver (gs=0xbfffd978) at grep.c:1504 A bandage patch may look like this. Bu

Re: 'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-09 Thread Nguyen Thai Ngoc Duy
On Tue, Oct 9, 2012 at 4:03 PM, Johannes Sixt wrote: > Running 'git grep needle origin/master' on Windows gives numerous warnings > of the kind > > warning: unable to access 'origin/master:Documentation/.gitattributes': > Invalid argument strace confirms it. Stack trace #0 read_attr_from_file (

'git grep needle rev' attempts to access 'rev:.../.gitattributes' in the worktree

2012-10-09 Thread Johannes Sixt
Running 'git grep needle origin/master' on Windows gives numerous warnings of the kind warning: unable to access 'origin/master:Documentation/.gitattributes': Invalid argument It is worrysome that it is attempted to access a file whose name is prefixed by a revision. -- Hannes -- To unsubscribe