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

Re: Git bug: Filter ignored when "--invert-grep" option is used.

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 15, 2021, 22:08 UTC
Message-ID
<xmqqzgp134i4.fsf@gitster.g>
In-Reply-To
<CAKDXFkMvXJm5+5Qxz2N5NH-s+nptayG_7+yTSPxynZxkOcaVKw@mail.gmail.com>
Dotan Cohen <dotancohen@gmail.com> writes:
Show 15 quoted lines
> What did you do before the bug happened?
> $ git log -8 --author=Shachar --grep=Revert --invert-grep
>
> What did you expect to happen?
> I expected to see the last 8 commits from Shachar that did not have
> the string "Revert" in the commit message.
>
> What happened instead?
> The list of commits included commits by authors other than Shachar.
>
> What's different between what you expected and what actually happened?
> The "--author" filter seems to be ignored when the "--invert-grep"
> option is used.
> I also tried to change the order of the options, but the results
> remained the same.

I think --author and --grep uses the same internal pattern matching engine, so with --invert-grep, I would not be surprised if the command looks for commits that do not have Revert and (or is that or? I dunno) not authored by Shachar.

Previous: Dotan CohenNext: Dotan Cohen
Message 2 of 6 in “Git bug: Filter ignored when "--invert-grep" option is used.”
  1. Dotan CohenDec 15, 2021
  2. Junio C HamanoDec 15, 2021
  3. Dotan CohenDec 16, 2021
  4. Junio C HamanoDec 16, 2021
  5. René ScharfeDec 17, 2021
  6. Junio C HamanoDec 17, 2021

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.