Skip to content

Release v0.13.8

Contribution Statistics - Per-author line-level code contribution analysis

Adds a new --contrib flag to the stats command for line-level contribution statistics, extends GitOperations with get_workdir() and get_commit_line_stats(), and updates documentation to clarify endpoint semantics and model compatibility.

Added

gcop-rs stats --contrib

  • New --contrib flag computes per-author line-level contribution statistics (insertions, deletions, total, percentage)
  • Uses git log --numstat for fast batch processing instead of querying each commit individually via git2
  • Merge commits are automatically excluded (--no-merges)
  • Supports author filtering (--author)
  • Output available in all formats: text (with colored bar chart), JSON, and Markdown

GitOperations Trait Extensions

  • get_workdir(): returns the repository working directory path; replaces ad-hoc repo.workdir() calls in unstage_all(), stage_files(), and compute_contrib_stats()
  • get_commit_line_stats(hash): returns per-commit insertion/deletion counts via git2's native Diff::stats()
  • CommitInfo extended with hash and parent_count fields for merge commit identification

Changed

Documentation - Endpoint Semantics

  • Clarified that endpoint supports both base URLs (https://api.anthropic.com) and full paths (https://api.anthropic.com/v1/messages)
  • Removed hardcoded model whitelists from all providers; added "Model Compatibility" sections explaining that any API-compatible model works
  • Updated example configurations to use base URLs

Dependencies

  • Lowered MSRV from 1.93.0 to 1.88.0
  • Updated tokio 1.49 → 1.50, which 8.0.0 → 8.0.2 and other dependencies

Tests

  • tests/stats_contrib_test.rs: 6 tests covering compute_contrib_stats() (basic stats, multi-commit, author filter, merge skip, percentages, empty repo)
  • tests/stats_test.rs: 6 tests covering RepoStats::from_commits() (basic stats, time span, author sort, weekly stats, author filter, edge cases)
  • tests/git_repository_test.rs: 3 tests for get_commit_line_stats() (initial commit, normal commit, invalid hash)

Upgrade

bash
# Homebrew
brew upgrade gcop-rs

# Cargo
cargo install gcop-rs

# pip
pip install --upgrade gcop-rs