Skip to content

Conversation

@kyle-rader
Copy link
Owner

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

Add AGENTS.md for agent contribution guidelines and introduce an author-stats command to analyze git history with time-based filtering and a terminal graph.

The AGENTS.md file provides clear instructions for automated agents on version bumping and semantic versioning. The new author-stats command offers a powerful way to visualize and summarize commit activity by author over specified time ranges, enhancing repository analysis capabilities.


Open in Cursor Open in Web


Note

Adds a stats subcommand to analyze first-parent commits by author with time-range filters and a terminal graph, introduces AGENTS.md, bumps version to 0.10.0, and adds chrono.

  • CLI:
    • New stats subcommand: Analyze first-parent commits by author with --days, --weeks, --months, --from, --to filters; outputs per-author counts and a scaled bar graph.
    • Helpers for time range resolution (resolve_time_range), date parsing (parse_naive_date), and graph rendering (print_author_graph).
  • Docs:
    • Add AGENTS.md with agent contribution/versioning guidance.
  • Release:
    • Bump crate version in Cargo.toml to 0.10.0.
    • Add chrono dependency.

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

This commit introduces a new `author-stats` command to analyze commit history by author over time. It also updates various dependencies and adds an AGENTS.md file.

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

cursor bot commented Nov 24, 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

@kyle-rader kyle-rader marked this pull request as ready for review December 2, 2025 08:17
@kyle-rader kyle-rader merged commit 1cac322 into main Dec 2, 2025
4 checks passed
@kyle-rader kyle-rader deleted the cursor/add-agent-docs-and-author-stats-command-gpt-5.1-codex-9f17 branch December 2, 2025 08:20
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.

days,
if days == 1 { "" } else { "s" }
);
start_dt = Some(dt);
Copy link

Choose a reason for hiding this comment

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

Bug: Inconsistent start time handling excludes commits

The --days and --weeks options calculate the start time by subtracting directly from reference_end_dt, preserving its time component. When combined with --to, this results in a start time at 23:59:59 of the start day rather than midnight. For example, --to 2023-12-15 --days 7 would start at 2023-12-08 23:59:59, excluding almost all commits from December 8th despite the label showing "2023-12-08 (last 7 days)". In contrast, --months and --from correctly use midnight via and_hms_opt(0, 0, 0). This inconsistency causes unexpected commit filtering.

Additional Locations (1)

Fix in Cursor Fix in Web

if days == 0 {
return Err(String::from("--days must be greater than zero."));
}
let dt = reference_end_dt - ChronoDuration::days(days as i64);
Copy link

Choose a reason for hiding this comment

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

Bug: Unchecked duration arithmetic can panic for extreme values

The --days and --weeks options use unchecked subtraction (reference_end_dt - ChronoDuration::days(...)) which can panic if the resulting date falls outside chrono's valid range (approximately ±262,000 years). Since days and weeks are u32, extreme values like --days 4294967295 would attempt to subtract ~11 million years and could crash. In contrast, --months correctly uses checked_sub_months with proper error handling. The days/weeks calculations need similar bounds checking.

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.

3 participants