Re: [PATCH 0/3] Make orphaned commit checks configurable
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Nov 10, 2026, 20:57 UTC
- Message-ID
- <dd253dfe-446e-4f2d-bd00-95ebc529cbc1@gmail.com>
- In-Reply-To
- <pull.2264.git.1794337920.gitgitgadget@gmail.com>
On 11/10/2026 2:11 PM, Wyatt Holden via GitGitGadget wrote:
> Hi there - my name's Wyatt Holden and I'm a Software Engineer at Microsoft > :) I've been working with Derrick Stolee over the past few weeks on > optimizing git in the Office mono-repo. We found some issues around slow > checkouts on mono-repos in an automated environment:
Welcome, Wyatt! (I was prepared for your series.)
Show 13 quoted lines
> When leaving a detached HEAD, git checkout and git switch > call orphaned_commit_warning() to warn about commits that are not reachable > from any existing ref or the destination HEAD. This requires enumerating > refs and walking commit history, which can be expensive in large > repositories. > > In an internal mono-repo, Trace2 showed tree unpacking finishing > approximately 12 seconds into checkout, but the process continuing for > roughly another 193 seconds. A stack dump captured the main thread inside > orphaned_commit_warning(), enumerating loose refs and opening ref files. > Running checkout with --quiet, which bypasses this routine, reduced the > observed runtime to approximately 14 seconds. However, --quiet also > suppresses unrelated output.
This example shows a significant pain caused by this check, but we also want to be able to see progress indicators over time in our logs, so using --quiet isn't preferred, long term.
> This three-commit series adds a targeted opt-out, advertises it when the > check is slow, and enables it in Scalar:
I did some pre-review with Wyatt (but found one nitpick in my on-list re-review) so I'm biased. Further bias: I recommended that he follow the model of the status.aheadBehind config [1] and advice.statusAheadBehind [2] patches as prior art.
[1] https://lore.kernel.org/git/2f0f2a2df9410947b985d83a924d2549d62bb65f.1560889284.git.gitgitgadget@gmail.com/
[2] https://lore.kernel.org/git/c1056545b617b89e881f5991beb2fe0d860de740.1560889284.git.gitgitgadget@gmail.com/
And also I added status.aheadBehind to Scalar's recommended config in its very first version [3]. Wyatt has updated the Scalar config docs that justify the recommendation, which was introduced only recently [4].
[3] https://lore.kernel.org/git/4439ab4de0bc3f48a6bdcf4b5165b16fad792ebd.1638538470.git.gitgitgadget@gmail.com/
[4] https://lore.kernel.org/git/f062b0e0773b9d168c031bb1f35538665394a077.1765552528.git.gitgitgadget@gmail.com/
So I give my support publicly for Wyatt's updates.
Thanks, -Stolee