From: Jakub Narebski Date: Fri, 20 Apr 2007 00:30:41 GMT Subject: Re: [PATCH 2/2] Add keyword unexpansion support to convert.c Message-ID: In-Reply-To: <200704171235.34793.andyparkins@gmail.com> Andy Parkins wrote: >>  * We do not do the borrowing from working tree when doing >>    grep_sha1(), but when we grep inside a file from working tree >>    with grep_file(), we do not currently make it go through >>    convert_to_git() to fix line endings.  Maybe we should, if >>    only for consistency. > > I'd actually argue not - git-grep searches the working tree.  The expanded > keywords are in the working tree.  Take the CRLF case - I'm a clueless user, > who only understands the system I'm working on.  I want to search for all the > line endings, so I do git-grep "\r\n" - that should work, because I'm > searching my working tree. Actually, "git grep" can search both the working tree (default), but also an index (--cached), or specified tree (or tree-ish). The same with "git diff": it can work on tree (repository), index, working tree version, now I think in [almost] any combination. Think what keyword expansion means to all this... Well, you can have -kk to expand/not expand keywords, but this is avoiding issue, not solving it -- Jakub Narebski Warsaw, Poland ShadeHawk on #git