Skip to content

Conversation

@kyle-rader
Copy link
Owner

@kyle-rader kyle-rader commented Nov 8, 2025

Add repo stats subcommand to display repository statistics including commit author frequency, total commits, and project age.


Open in Cursor Open in Web


Note

Adds a repo stats CLI subcommand that reports total commits, project age, and commits per author.

  • CLI:
    • Add Repo command with Stats subcommand in src/main.rs.
    • Route Cli::Repo { command: RepoSubcommand::Stats } to repo_stats().
  • Logic:
    • Implement repo_stats() to aggregate commit authors, compute total commits, determine first commit timestamp/date, and print stats.
    • Add format_duration() helper to format elapsed time.

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

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

cursor bot commented Nov 8, 2025

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

cursoragent and others added 2 commits November 8, 2025 06:37
Co-authored-by: kylewrader <kylewrader@gmail.com>
Co-authored-by: kylewrader <kylewrader@gmail.com>
@kyle-rader kyle-rader marked this pull request as ready for review November 8, 2025 06:40
@kyle-rader kyle-rader merged commit bc75eb7 into main Nov 8, 2025
4 checks passed
@kyle-rader kyle-rader deleted the cursor/add-repo-stats-command-a245 branch November 8, 2025 06:41
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.

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.

parts.push(format!("{minutes}m"));
}
let remaining_seconds = duration.as_secs() % 60;
if parts.is_empty() || remaining_seconds > 0 && parts.len() < 3 {
Copy link

Choose a reason for hiding this comment

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

Bug: Time Displays Silently Drop Seconds

The condition parts.len() < 3 prevents seconds from being displayed when there are exactly 3 other time components (e.g., years, days, hours), causing data loss. For example, a duration of 1 year + 2 days + 3 hours + 30 seconds would display as "1y 2d 3h", silently dropping the 30 seconds. The condition should likely be parts.len() < 4 to allow up to 4 total components including seconds.

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.

3 participants