On Wed, Oct 10, 2012 at 1:59 AM, Junio C Hamano <gits...@pobox.com> wrote: > Jeff King <p...@peff.net> 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.
Here we go. No additional tests as I don't know how to write them. But strace shows it's ok. Currently we don't have many options to optimize attr access. We cannot prepare a attr stack in advance for a specific directory, then check attributes many times using the stack. We cannot prepare attr stack from a tree object. As a result a normal "grep pattern --" results in a lot of duplicate failed open(".../.gitattributes") calls. Jeff King (1): grep: pass true path name to grep machinery Nguyễn Thái Ngọc Duy (2): quote: let caller reset buffer for quote_path_relative() grep: stop looking at random places for .gitattributes Documentation/git-grep.txt | 7 +++++-- builtin/clean.c | 2 ++ builtin/grep.c | 19 ++++++++++++------- builtin/ls-files.c | 1 + grep.c | 11 ++++++++--- grep.h | 4 +++- quote.c | 1 - wt-status.c | 1 + 8 files changed, 32 insertions(+), 14 deletions(-) -- 126.96.36.199.406.g6ab07c4 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html