Re: [PATCH] grep: fix grepping for "intent to add" files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 16, 2016, 18:12 UTC
- Message-ID
- <xmqq7fdp57gg.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160616065324.GA14967@hashpling.org>
Charles Bailey <charles@hashpling.org> writes:
Show 7 quoted lines
> http://thread.gmane.org/gmane.comp.version-control.git/272363/focus=276358 > > http://thread.gmane.org/gmane.comp.version-control.git/283001/focus=283002 > > Unless I've misunderstood the conversation and commit message, the > referenced commit was supposed to be a "code as a comment" commit with > no change in observable behavior
Thanks for a pointer; 276358 claims that ce->ce_mode would be zero for path added with "git add -N path", but I do not think it is correct.
The updated behaviour is more understandable. With "add -N", the user said "Just keep an eye on this path, I cannot decide what the contents for this path in the index should be at this moment". grep_cache() that checks the contents in the index cannot say what is in the index, because the contents is not yet there.