Skip to content

Repo stats full history#33

Merged
kyle-rader merged 2 commits intomainfrom
cursor/repo-stats-full-history-95e4
Feb 2, 2026
Merged

Repo stats full history#33
kyle-rader merged 2 commits intomainfrom
cursor/repo-stats-full-history-95e4

Conversation

@kyle-rader
Copy link
Owner

@kyle-rader kyle-rader commented Feb 2, 2026

Remove --first-parent from repo stats to include all history reachable from HEAD.

The previous implementation only considered the first parent history, which could omit relevant contributions from merged branches. This change ensures that repo stats provides a comprehensive view of all work landed in the repository.


Open in Cursor Open in Web


Note

Low Risk
Small, localized change to a reporting-only command; primary risk is altered stats output/perf on very large repos when not using --first-parent.

Overview
repo stats now analyzes all commits reachable from HEAD by default (instead of always using --first-parent), with a new --first-parent flag to opt back into the previous behavior.

Docs/help text were updated accordingly, and the empty-result message now distinguishes between “no commits” vs “no first-parent commits”. The crate version was bumped to 1.9.0.

Written by Cursor Bugbot for commit dc11c26. This will update automatically on new commits. Configure here.

Co-authored-by: kylewrader <kylewrader@gmail.com>
@cursor
Copy link

cursor bot commented Feb 2, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Co-authored-by: kylewrader <kylewrader@gmail.com>
@kyle-rader kyle-rader marked this pull request as ready for review February 2, 2026 00:35
@kyle-rader kyle-rader merged commit 01987c7 into main Feb 2, 2026
4 checks passed
@kyle-rader kyle-rader deleted the cursor/repo-stats-full-history-95e4 branch February 2, 2026 00:35
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

if options.first_parent {
git_args.push("--first-parent".to_string());
}
git_args.push("--pretty=format:%ct%x09%an%x09%ae".to_string());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per-author activity stats assume chronological ordering that no longer holds

Medium Severity

The per-author timestamp tracking at lines 325-328 relies on commits arriving in reverse-chronological order (as documented in the comments at lines 318 and 322-324). With --first-parent, this was guaranteed. Without it, git log uses topological ordering where commits from merged branches may not appear in strict date order. This causes latest_commit_ts_by_author and oldest_commit_ts_by_author to potentially hold swapped or incorrect values, leading to wrong "commits per week" rates and "active span" displays. When latest_ts < oldest_ts, saturating_sub returns 0, artificially inflating the rate calculation.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments