20 releases

0.1.20 Feb 28, 2025
0.1.19 Dec 19, 2024
0.1.18 Oct 1, 2024
0.1.16 May 3, 2024
0.1.5 Nov 23, 2022

#818 in Command line utilities

Download history 1/week @ 2024-11-24 19/week @ 2024-12-01 6/week @ 2024-12-08 125/week @ 2024-12-15 21/week @ 2024-12-22 90/week @ 2024-12-29 2/week @ 2025-02-02 118/week @ 2025-02-23 52/week @ 2025-03-02 5/week @ 2025-03-09

175 downloads per month

BlueOak-1.0.0

19KB
337 lines

📊
git stats

A tool for getting aggregated commit stats.


Git Stats parses log information to get stats about the files changed, additions, and deletions. For example:

$ git stats -r origin..HEAD
 Author           Commits  Changed Files  Insertions  Deletions  Net Δ
 Luke Hsiao            67            117       +2616      -1126  +1490
 dependabot[bot]       31             62        +203       -267    -64
 Total                 98            179       +2819      -1393  +1426

 Reviewer/Tester  Commits
 Luke Hsiao             1

Install

This is a glorified shell script. As such, it expects that you have git, sort, and uniq installed on your machine and in your $PATH.

From crates.io

cargo install git-stats --locked

Usage

A tool for getting aggregated commit stats

Usage: git-stats [OPTIONS] [revision-range]

Arguments:
  [revision-range]  Show only commits in the specified revision range [default: HEAD]

Options:
  -e, --email            Show the email address of each author
  -r, --reviews          Show who reviewed/tested commits based on `Acked-by`, `Tested-by`, and `Reviewed-by` git trailers
  -s, --sort <SORT>      What column to sort by [default: commits] [possible values: author, commits, files, insertions, deletions, net]
      --reverse          Whether to reverse the sorting from descending to ascending
  -a, --author <AUTHOR>  Limit the commits output to ones with author header lines that match the specified pattern (regular expression)
      --since <SINCE>    Limit the commits output to ones more recent than a specific date
      --until <UNTIL>    Limit the commits output to ones older than a specific date
  -h, --help             Print help (see more with '--help')
  -V, --version          Print version

TODO

  • [] It would be nice to support all git log flags automatically, just passing them through directly and then doing the math only.

Dependencies

~8–17MB
~256K SLoC