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

Re: bug: `git log --grep ... --invert-grep --author=...` negates / ignores --author

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 1, 2017, 02:20 UTC
Message-ID
<xmqqtw4078ka.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CACBZZX7OhdRM+Mhx4FVX-Upvq169ZLvArL5ZxcTgz8u=WRh3aw@mail.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 14 quoted lines
> $ git log --grep=bar --invert-grep --author=Ævar --pretty=format:%an
> -100 origin/pu |sort|uniq -c|sort -nr
>      78 Junio C Hamano
>      14 Jeff King
>       2 Andreas Heiduk
>       1 Sahil Dua
>       1 Rikard Falkeborn
>       1 Johannes Sixt
>       1 Johannes Schindelin
>       1 Ben Peart
>       1 Ævar Arnfjörð Bjarmason
>
> That last command should only find my commits, but instead --author is
> discarded.

Hmph, the way I read revision.c::commit_match() is that we check with "--grep=bar --author=Ævar" and then emit the commit if that check fails when --invert-grep is in effect (instead of emitting the commit when the check succeeds, which is the normal case).

So there is one commit that didn't pass "has 'bar' and written by Ævar" check that was written by you in the recent past (iow, recently you were writing bar all over the place). Changes by other people by definition does not pass "has 'bar' and written by Ævar" check, on the other hand.

Previous: Junio C Hamano
Message 7 of 7 in “bug: `git log --grep ... --invert-grep --author=...` negates / ignores --author”
  1. Anthony SottileMay 31, 2017
  2. Ævar Arnfjörð BjarmasonMay 31, 2017
  3. Jeff KingMay 31, 2017
  4. Ævar Arnfjörð BjarmasonJun 1, 2017
  5. Anthony SottileJun 1, 2017
  6. Junio C HamanoJun 1, 2017
  7. Junio C HamanoJun 1, 2017

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.