feat(repo stats): default to walking all commits (with patch-id dedup)#41
Merged
kyle-rader merged 2 commits intoMay 23, 2026
Conversation
Flip the default commit walk from `--first-parent` back to all commits.
The `--first-parent` default was introduced as a workaround for inflated
contributor counts after the cross-repo-history merge in a downstream
Microsoft repo, but the workaround over-corrected — it silently dropped
all authorship from history that was merged in via a side-parent.
Now that patch-id dedup (v2.5.0) handles duplicate-commit inflation
properly, restoring the all-commits default gives a much more accurate
picture of who actually contributed to a repo.
Concrete impact in the case-study repo:
Before this PR (default = --first-parent):
Kyle Rader: 131 commits over 6.1 months (drops 14+ months of work)
After this PR (default = all + dedup):
Kyle Rader: 413 commits over 1.2 years (matches reality)
--no-dedup (raw SHA counts, for reference):
Kyle Rader: 704 commits over 1.2 years (inflated by ~290 dup patches)
The `--first-parent` behavior remains available as an opt-in flag for
users who want one-tally-per-PR (e.g. mainline-merge release-history view).
The deprecated `--all` flag is kept as a hidden no-op so existing scripts
and muscle memory don't break — walking all commits is now the default.
Bumps the crate version 2.5.0 -> 2.6.0 (backward-compatible default flip).
Since we're introducing --first-parent as the opt-in toggle in the same release, just drop --all entirely rather than carrying a no-op deprecation shim.
kyle-rader
approved these changes
May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In v2.0.0 (Feb 2, 2026) we flipped the default commit walk in
lk repo statsto--first-parentas a workaround for inflated contributor counts after merging a large external history into a downstream repo. That workaround over-corrected: it silently drops all authorship from history that was merged in via a side-parent — i.e. it hides every commit behind a graft merge from the contributor view.Now that patch-id dedup (v2.5.0, PR #40) handles the duplicate-commit inflation properly, the
--first-parentdefault is no longer needed and is actively wrong: it suppresses real contributions.Case study (same repo as v2.5.0)
--first-parent)--no-dedupfor reference(The same person's oldest commit reachable from HEAD via
--first-parentis 2025-11-17; via all refs it's 2025-03-10. The first-parent walk hides 8 months of legitimate authorship.)Solution
--allopt-in flag (it became meaningless once "all" is the default).--first-parentopt-in flag for users who want the one-tally-per-merge release-history view.--first-parentwhen you want PR-granularity.Compat
Defaults change. Anyone scripted on the old default gets the (more accurate) all-commits view; they can restore previous output with
--first-parent. The old default existed for ~3.5 months. Anyone scripted onlk repo stats --allshould drop the flag — it now errors.Bumps the crate version 2.5.0 → 2.6.0.