Re: bugreport: performance regression on git log --follow
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 4, 2026, 15:56 UTC
- Message-ID
- <autVqTLs_pgwVcSE@pks.im>
- In-Reply-To
- <1491d49cdb1a96698e5572d9de3ac280@posteo.de>
On Wed, Nov 04, 2026 at 07:58:25AM +0000, b.murauer@posteo.de wrote:
Show 38 quoted lines
> Thank you for filling out a Git bug report! > Please answer the following questions to help us understand your issue. > > What did you do before the bug happened? (Steps to reproduce your issue) > > I ran git log --follow on a single file in a repository with about 30k > commits > and 27k tracked files: > > git log --follow --oneline -- path/to/file.ts >/dev/null > > VS Code's Timeline view runs a similar command automatically: > > git log --no-ext-diff --no-textconv --format=<format> -z -n551 > --shortstat \ > --follow -- path/to/file.ts > > We regularly merge older maintenance branches forward into main. The > affected > file was added on main and does not exist on those branches, so many merges > have > a parent that lacks it. The following command reports 692 commits for this > file: > > git log --full-history -m --diff-filter=A --format=%h -- path/to/file.ts > | > sort -u | wc -l > > What did you expect to happen? (Expected behavior) > > I expected the command to finish in a time comparable to earlier Git > versions. > With Git 2.43 on the same history, it takes about 1 second. > > What happened instead? (Actual behavior) > > With Git 2.56, the command takes around 10 minutes. It uses one CPU core > for the whole run, with very little system time, and output appears slowly.
Thanks for your report! This is a known issue which was originally reported at [1]. That thread also has some patches that are currently in review.
Patrick
[1]: https://lore.kernel.org/git/as44NVKZA9C9S5ae@pks.im/