Re: [bug] git log --invert-grep --grep=[sufficiently complicated regex] prints nothing
- From
- Zack Weinberg <zack@owlfolio.org>
- Date
- Nov 24, 2022, 13:36 UTC
- Message-ID
- <cfbd647e-0e66-4417-8c94-c8cac905a78a@app.fastmail.com>
- In-Reply-To
- <909b0770-2ac2-1a87-498b-0537a94e94ac@dunelm.org.uk>
On Thu, Nov 24, 2022, at 5:31 AM, Phillip Wood wrote:
> I think the problem is that you are excluding the commit that renames > the file and that stops --follow from following the rename. See below > for a simple reproduction using git's test suite.
Yes, I can confirm. Both of the "incorrect output" examples I gave involved excluding a commit that renames the file. If I don't do that there is no problem with an `a|b|c` regex.
> I'm afraid I'm not > familiar with the --follow code so I've no idea how to fix this.
I'm honestly unsure what the right behavior _should_ be, now. I expected --grep to be applied very late in the process, after the set of commits touching the specified file had already been computed (including all of its previous names, because of --follow) but the documentation is ambiguous.
zw