Skip to main content

Fast Git analytics tool powered by Rust, providing detailed author contribution statistics including commits, lines of code, insertions, deletions, and churn.

Project description

git-repostats

A fast CLI tool and library to analyze Git repositories and generate detailed contribution statistics.

Features

  • Author-wise contribution stats
  • High performance (Rust-based)
  • Metrics:
    • Commits
    • Files
    • Surviving lines
    • Insertions / Deletions
    • Net lines
    • Churn
  • Limit output (--limit)
  • Smart aggregation (OTHER bucket)

Installation

Using PIP

pip install git-repostats

Usage

git-repostats --metrics <metrics> --limit <N> <repo_path>
python -m git_repostats --metrics <metrics> --limit <N> <repo_path>

Documentation

Usage: git-repostats [OPTIONS] [GITDIR]...

Arguments:
  [GITDIR]...
          Git repository directory or directories to analyze.

          [default: .]

Options:
      --branch <BRANCH>
          Branch or tag up to which to check.

          [default: HEAD]

      --metrics <METRICS>...
          Select which metrics to compute.

          Possible values:
          - commits: Commit count per author
          - files:   Number of unique files modified by the author
          - history: Commit count, files, insertions, deletions, net change, and churn
          - current: Commit count, files, and surviving lines in the current code state
          - all:     Combine history and current metrics

          [default: commits]

      --sort <SORT>
          Sort output by the specified metric.
          Sorting is descending by default.

          Possible values:
          - commits:    Number of commits authored by the user
          - files:      Number of unique files modified by the user across all commits
          - insertions: Total number of lines added by the user
          - deletions:  Total number of lines removed by the user
          - net:        Net line change introduced by the user (insertions minus deletions)
          - churn:      Total lines of code modified by the user (insertions plus deletions)
          - surviving:  Number of lines currently present in the codebase that are attributed to the user

      --reverse
          Reverse the sort order from descending to ascending.

  -l, --limit <N|all>
          Limit number of authors displayed in the output. Use `all` for no limit.

          [default: 10]

      --since <DATE>
          Include only commits after the specified date.
          Accepts any date format supported by Git.

      --until <DATE>
          Include only commits before the specified date.
          Accepts any date format supported by Git.

      --show <SHOW>
          Author information to show.

          Possible values:
          - name:  Author name only
          - email: Author email only
          - both:  Author name and email

          [default: both]

  -M, --detect-moves
          Detect moved lines when computing metrics.
          Improves accuracy for refactors at the cost of performance.

  -C, --detect-copies
          Detect copied lines across files when computing metrics.

  -w, --ignore-whitespace
          Ignore whitespace-only changes when computing current metrics.

      --threads <THREADS>
          Number of parallel git operations. 0 = auto (min(CPU cores, 4)).

          [default: 0]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Example

git-repostats --metrics all --limit=5 "/path/to/sample-repo"
Done sample-repo in 2 seconds
==========================================================================================================================
 Repository: sample-repo
==========================================================================================================================
 Author                                                Commits ↓  Files  Surviving  Insertions  Deletions      Net   Churn
--------------------------------------------------------------------------------------------------------------------------
 Alice <alice@example.com>                                    50    120      8,500      +5,000     -1,200   +3,800   6,200
 Bob <bob@example.com>                                        30     80      5,200      +3,000       -900   +2,100   3,900
 Charlie <charlie@example.com>                                20     40      2,800      +1,500       -300   +1,200   1,800
 David <david@example.com>                                    15     35      2,100      +1,200       -200   +1,000   1,400
 Eve <eve@example.com>                                        10     25      1,400        +900       -150     +750   1,050
--------------------------------------------------------------------------------------------------------------------------
 OTHER (3 authors)                                            12     30      1,800      +1,000       -250     +750   1,250
--------------------------------------------------------------------------------------------------------------------------
 TOTAL (8 authors)                                           137    330     23,800     +13,600     -3,000  +10,600  15,600

Contributing

Contributions are welcome! Feel free to open issues or PRs.

License

The git-repostats is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_repostats-0.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

git_repostats-0.1.0-py3-none-win_amd64.whl (726.4 kB view details)

Uploaded Python 3Windows x86-64

git_repostats-0.1.0-py3-none-manylinux_2_28_x86_64.whl (838.7 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

git_repostats-0.1.0-py3-none-manylinux_2_28_aarch64.whl (783.1 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

git_repostats-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (838.3 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

git_repostats-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (782.6 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

git_repostats-0.1.0-py3-none-macosx_11_0_arm64.whl (716.6 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

git_repostats-0.1.0-py3-none-macosx_10_12_x86_64.whl (779.5 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file git_repostats-0.1.0.tar.gz.

File metadata

  • Download URL: git_repostats-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for git_repostats-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6cb1fc3cffb8ea5bb58605fe4da1182f839867e34acf32b85bca5049bbe3c41f
MD5 a9b9d2beedd872fe45e983418bdee5b3
BLAKE2b-256 4920cb014a4fc763c67b9bcaaba36e374beaeb676d0ebea804cf142a11fa2452

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_repostats-0.1.0.tar.gz:

Publisher: release.yml on kishorninawe/git-repostats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_repostats-0.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: git_repostats-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 726.4 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for git_repostats-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 fc5ef0277a976a3035e23b4972de185b2b967ab83235da503be7d2231b4067f7
MD5 959675bfdde2be23c6057dbc69211f74
BLAKE2b-256 86bcdf46199522de486791b315fdba8e2d2946e950b62a239bdf270875a38245

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_repostats-0.1.0-py3-none-win_amd64.whl:

Publisher: release.yml on kishorninawe/git-repostats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_repostats-0.1.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for git_repostats-0.1.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 65dbcc974d4dde0e01812fa87c7da0f8119fb20ac08a1355b4bfba7a9bd706cf
MD5 2e62170e1d642d632a5bceadedfa3bf1
BLAKE2b-256 94295bda34f0673da2ae1fa2e98592aa5831838f982ef526b84687493ed40ba2

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_repostats-0.1.0-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on kishorninawe/git-repostats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_repostats-0.1.0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for git_repostats-0.1.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 39dfab4ecc2132f589ad3fffd6014412da957c48c35b8d82f0d05d70bf97d17e
MD5 2945f411d791ac45551e1053a8ea4fdd
BLAKE2b-256 cbeb580f2ac482fea0cea6617cc38e5fc5a1c8a142ab2097cfc799b504e34a53

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_repostats-0.1.0-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on kishorninawe/git-repostats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_repostats-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for git_repostats-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f07e071f7d29982bccc5530c1065ce434315d40013dcfe6293319665ec03c13d
MD5 68ecc0f57e28c2f6e4cc46d80e5152ed
BLAKE2b-256 787795ae27505453fc4eea54f7b62a39caddc30f384402c4e201a35e87374848

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_repostats-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on kishorninawe/git-repostats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_repostats-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for git_repostats-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b6e8cb1f302ffc21cb9288f2044d19b14776bc227daf03338d7f4f4ee08e6134
MD5 05b1ab1880877597aad21b01b4693420
BLAKE2b-256 1fd68229d4d8f6b5e0e4e751e279d0c4fae81b21d982a00c69dbae8a25746c73

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_repostats-0.1.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on kishorninawe/git-repostats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_repostats-0.1.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for git_repostats-0.1.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b6afab781f9c8f6506f99aa6a792382ce38b2784ccf320994c1032b09eb4d0a
MD5 89cad543a817df962e4f879f763e8945
BLAKE2b-256 688c4554132f228ea16242023a5e4920707d3cd42031c16e5cf130d19750d0f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_repostats-0.1.0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on kishorninawe/git-repostats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_repostats-0.1.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for git_repostats-0.1.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 520e4157a25dbefc44df0f1ad9e1f5cf4b42a4a62bbc2105cca7898e645a29bb
MD5 855b005704fe79792033c0cc0696065d
BLAKE2b-256 497b042dccc446012d494ca5e6f1e33be231eb8aa19d7c5e71d03035789325d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_repostats-0.1.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on kishorninawe/git-repostats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page