Skip to main content

Git Commit Tracker

Git Commit Tracker is a small CLI utility to determine which tests a given Git commit touches by mapping changed file ranges to test definitions discovered via Tree-sitter ASTs.

Key principles

  • AST-first: parse files to locate test definitions and compute exact line ranges.
  • Language-driven: pick a parser by file extension and cache parsers for reuse.
  • Conservative impact: report tests that overlap changed line ranges (added, removed, or modified).

Quick start

Prerequisites

  • Python 3.8+
  • Git

Install for development

python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Install from PyPI

pip install git-commit-tracker

Run the CLI

impact-analyzer --commit <SHA> --repo <PATH_OR_URL>

Common examples

  • Analyze a remote repo (auto-clones): impact-analyzer --commit 75cdcc5 --repo https://github.com/example/repo
  • Analyze a local repo: impact-analyzer --commit 45433fd --repo ./my-local-project
  • Analyze a private repo: impact-analyzer --commit 45433fd --repo https://<your-access-token>@github.com/owner/repo.git

What it detects

  • JavaScript / TypeScript: test, it, describe call expressions (including .only, .skip).
  • Python: functions named test_*.
  • Other languages: extend by adding parsers and detection rules.

Project structure

  • src/impact_analyzer/cli.py: CLI entrypoint and repo handling (cloning, temp dirs).
  • src/impact_analyzer/engine.py: Main orchestration—diff inspection, parsing, and result formatting.
  • src/impact_analyzer/parser.py: Tree-sitter parsing and AST traversal to find tests and ranges.
  • src/impact_analyzer/languages.py: Extension-to-parser mapping and parser caching.
  • src/impact_analyzer/git_utils.py: Helpers to extract changed line ranges from commit diffs.

Architecture notes

  • The CLI resolves the repo (local path or remote URL) and checks out the requested commit.
  • git_utils extracts hunks and changed line sets between the commit and its parent.
  • Parsers in languages.py are looked up by extension; parser.py walks the AST and emits test identifiers and their line ranges.
  • engine.py computes intersections between changed lines and test ranges to produce the final impact report.

Extending the tool

  1. Add a Tree-sitter grammar dependency (if needed) and expose it via languages.py.
  2. Add detection logic for new test forms in parser.py.

License

MIT

Metadata

Release files for git-commit-tracker 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-commit-tracker 0.1.0
File Size Uploaded Provenance Actions
git_commit_tracker-0.1.0.tar.gz 6.9 kB Without provenance Details for git_commit_tracker-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for git-commit-tracker 0.1.0
File Interpreter ABI Platform Actions
git_commit_tracker-0.1.0-py3-none-any.whl Python 3 none any Details for git_commit_tracker-0.1.0-py3-none-any.whl

Total release size: 15.2 kB

Release files / git_commit_tracker-0.1.0.tar.gz

Download URL git_commit_tracker-0.1.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0d44657edde988a5840f2d9f02ef74e5eb926696225b93aee43690ac35b764f3
BLAKE2b-256 checksum
How to use checksums
2cb220b272e01ee67e106d0daf2e6c20496de95fab1a6d3853942480de81b160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / git_commit_tracker-0.1.0-py3-none-any.whl

Download URL git_commit_tracker-0.1.0-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b7c8bb4ac80205db1d56602790201550b784d5583ca97487ade63eac345ef71
BLAKE2b-256 checksum
How to use checksums
d6eb7558b57d9b9922d7783687cca0cce633e43e14a9f64e4a34e7a895d6429a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for git-commit-tracker 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page