-
Notifications
You must be signed in to change notification settings - Fork 0
Add agent docs and author stats command #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add agent docs and author stats command #21
Conversation
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 Agent can help with this pull request. Just |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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)
| if days == 0 { | ||
| return Err(String::from("--days must be greater than zero.")); | ||
| } | ||
| let dt = reference_end_dt - ChronoDuration::days(days as i64); |
There was a problem hiding this comment.
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.
Add
AGENTS.mdfor agent contribution guidelines and introduce anauthor-statscommand to analyze git history with time-based filtering and a terminal graph.The
AGENTS.mdfile provides clear instructions for automated agents on version bumping and semantic versioning. The newauthor-statscommand offers a powerful way to visualize and summarize commit activity by author over specified time ranges, enhancing repository analysis capabilities.Note
Adds a
statssubcommand to analyze first-parent commits by author with time-range filters and a terminal graph, introducesAGENTS.md, bumps version to 0.10.0, and addschrono.statssubcommand: Analyze first-parent commits by author with--days,--weeks,--months,--from,--tofilters; outputs per-author counts and a scaled bar graph.resolve_time_range), date parsing (parse_naive_date), and graph rendering (print_author_graph).AGENTS.mdwith agent contribution/versioning guidance.Cargo.tomlto0.10.0.chronodependency.Written by Cursor Bugbot for commit 35bfc8d. This will update automatically on new commits. Configure here.