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

[PATCH v3 0/3] Grepping with intent to add

From
Charles Bailey <charles@hashpling.org>
Date
Jun 30, 2016, 10:13 UTC
Message-ID
<20160630101348.15665-1-charles@hashpling.org>
So I've got back around to this topic again.
I've applied fixes to the tests as suggested by Eric and Junio.

I came up with a test case that demonstrates a difference between the additional fix that Duy suggested and the alternative that Junio suggested.

I've kept Duy's fix because I think it makes more sense, although it's a sufficiently obscure case that I don't feel strongly that it's definitely the best behavior.

The fix ensures that if you have a file which is both "intend to add" and "assume unchanged" that it is not listed if you "grep -L" for for something. In effect, we are applying the "contents indeterminate" state of the index to the working tree file.

Charles Bailey (3):
  t7810-grep.sh: fix duplicated test name
  t7810-grep.sh: fix a whitespace inconsistency
  grep: fix grepping for "intent to add" files
 builtin/grep.c  |  4 ++--
 t/t7810-grep.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 62 insertions(+), 4 deletions(-)
-- 
2.8.2.311.gee88674
Next: Charles Bailey
Message 1 of 7 in “Grepping with intent to add”
  1. 0/3 Grepping with intent to addCharles Bailey, Jun 30, 2016
  2. 3/3 grep: fix grepping for "intent to add" filesCharles Bailey, Jun 30, 2016
  3. Junio C HamanoJul 1, 2016
  4. 2/3 t7810-grep.sh: fix a whitespace inconsistencyCharles Bailey, Jun 30, 2016
  5. 1/3 t7810-grep.sh: fix duplicated test nameCharles Bailey, Jun 30, 2016
  6. Junio C HamanoJul 1, 2016
  7. Junio C HamanoJul 1, 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.