Re: What's cooking in git.git (Jul 2016, #02; Wed, 6)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 7, 2016, 21:21 UTC
- Message-ID
- <xmqqshvlnnzb.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160707204002.GA19138@hashpling.org>
Charles Bailey <charles@hashpling.org> writes:
> I just wanted to clarify what was actually fixed. The actual bug that > was reported and fixed was the fact that 'git grep' (without --cached) > wasn't searching the contents of files in the working tree if the index > entry had the "intent to add" bit set.
Ouch, you are absolutely right.
Git does not know what the contents in the index should be for a path added with "git add -N" yet, so "git grep --cached" should not show hits (or show lack of hits, with -L) in such a path, but that logic does not apply to "git grep", i.e. searching in the working tree files. But we did so by mistake, which has been corrected.
perhaps?
Thanks.