git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] grep: fix grepping for "intent to add" files

From
Charles Bailey <charles@hashpling.org>
Date
Jun 16, 2016, 09:47 UTC
Message-ID
<20160616094749.GA20681@hashpling.org>
In-Reply-To
<20160616074709.GA24412@duynguyen-vnpc.vn.dektech.internal>
On Thu, Jun 16, 2016 at 02:47:09PM +0700, Duy Nguyen wrote:
Show 5 quoted lines
> I don't think revert is right. It rather needs a re-fix like below.
> Basically we want grep_file() to run as normal, but grep_sha1()
> (i.e. git grep --cached) should ignore i-t-a entries, because empty
> SHA-1 is not the right content to grep. It does not matter in positive
> matching, sure, but it may in -v cache.

You don't think the revert is correct or you don't think the revert is sufficient? (I wasn't able to find a test case which proved that the change to line 399 was necessary, so perhaps I don't understand.)

I would have thought that grepping the empty SHA-1 would be correct for with or without -v. An "intent to add" file has no content in the index so I would expect it to have zero matching and zero non-matching lines for any grep --cached query?

Or is this an efficiency and not a correctness concern?
Charles.
Previous: Duy NguyenNext: Duy Nguyen
Message 4 of 8 in “grep: fix grepping for "intent to add" files”
  1. grep: fix grepping for "intent to add" filesCharles Bailey, Jun 16, 2016
  2. Junio C HamanoJun 16, 2016
  3. Duy NguyenJun 16, 2016
  4. Charles BaileyJun 16, 2016
  5. Duy NguyenJun 16, 2016
  6. Charles BaileyJun 16, 2016
  7. Duy NguyenJun 16, 2016
  8. Junio C HamanoJun 16, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.