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

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

From
Duy Nguyen <pclouds@gmail.com>
Date
Jun 16, 2016, 12:11 UTC
Message-ID
<CACsJy8AdHMdj9y6WnqqNyEaaW-OHhqR3KTN0Gvd8sPqnbnaY+g@mail.gmail.com>
In-Reply-To
<20160616114452.GA21930@hashpling.org>
On Thu, Jun 16, 2016 at 6:44 PM, Charles Bailey <charles@hashpling.org> wrote:
Show 17 quoted lines
> On Thu, Jun 16, 2016 at 05:57:18PM +0700, Duy Nguyen wrote:
>>
>> "git grep --cached" searches file content that will be committed by
>> "git commit" (no -a). An i-t-a entry will not be committed (you would
>> need "git add" first, or do "git commit -a"). So if I say "search
>> among the to-be-committed file content, list files that do not match
>> abc" (git grep -l -v --cached abc), the i-t-a entry will show up
>> because its fake content is empty (i.e. not contain "abc"), even
>> though it's not in the "to-be-committed" list. So yeah, correctness
>> issue.
>
> OK, I think there is an issue there but it's not with "-l -v --cached"
> but rather with "-L --cached". If my understanding is correct, "-l -v"
> means "has a line that doesn't match" whereas "-L" means "has no line
> that matches".
>
> Does this sound correct? I'll try adding a new test.
Yeah "-L --cached" should work the same, I think.
-- 
Duy
Previous: Charles BaileyNext: Junio C Hamano
Message 7 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.