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

Re: [bug] git log --invert-grep --grep=[sufficiently complicated regex] prints nothing

From
Jeff King <peff@peff.net>
Date
Nov 24, 2022, 16:35 UTC
Message-ID
<Y3+dRELMa8AXZ0tZ@coredump.intra.peff.net>
In-Reply-To
<221124.861qpspckm.gmgdl@evledraar.gmail.com>
On Thu, Nov 24, 2022 at 04:53:28PM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 17 quoted lines
> This doesn't help with your case, but I remember there being some
> similar confusions and/or expectations mismatches reported in the
> patch. E.g. "--since" here:
> https://lore.kernel.org/git/220401.86pmm1nmvh.gmgdl@evledraar.gmail.com/
> 
> I couldn't find a reference quickly, but I seem to recall (but perhaps
> I'm imagining it) that we had a report/discussion semi-recently about:
> 
> 	git log --reverse --follow -- path
> 
> Which has a similar edge case, e.g. try on git.git:
> 
> 	git log --reverse --follow -- object-name.c
> 
> That's also "correct" if you look at it from the POV of how we implement
> it, i.e. we'll traverse, and the rename to object-name.c is the first
> time we encounter the name from the POV of the walking logic.

I think all of this goes back to Linus's original "--follow is a hack I bolted on" implementation. It probably should happen up-front as part of the history simplification. I think it's a combination of nobody wanting to do the work to extract that, and that it may produce less "streaming" output, as we have to do a lot more work before producing the first line of output.

-Peff
Previous: Ævar Arnfjörð Bjarmason
Message 5 of 5 in “[bug] git log --invert-grep --grep=[sufficiently complicated regex] prints nothing”
  1. Zack WeinbergNov 23, 2022
  2. Phillip WoodNov 24, 2022
  3. Zack WeinbergNov 24, 2022
  4. Ævar Arnfjörð BjarmasonNov 24, 2022
  5. Jeff KingNov 24, 2022

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.