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