Skip to main content

git-hot

git-hot is a Git extension that reports how ``hot'' (often-changing) the current lines or files in a repository are. It derives line lifetime and churn information from Git history, then highlights files and lines that have changed often or recently.

Install the package and run it as either:

git hot
git-hot

The package installs two commands:

  • git-hot, the Git extension command; manual page.
  • daglp, a helper, written in Rust, used to compute the longest path through the Git commit DAG; manual page.

Command installation

The git-hot command (is hosted on PyPI)[https://pypi.org/project/git-hot/]. It can therefore be easily installed with a Python package manager.

As an individual user

uv tool install git-hot

or

pipx install git-hot

or (discouraged legacy method)

pip install --user git-hot

For all users

sudo pipx install --global git-hot

In an active virtual environment

uv pip install git-hot
python -m pip install git-hot

After installation, ensure the installation's script directory is on PATH so Git can find git-hot and you can invoke it as git hot.

Usage

Show hot files (those with often-changing lines) in the current repository:

git hot

Show hot files at a specific revision:

git hot HEAD

Show line-level churn (times each line was changed) for one file:

git hot -- src/main.py

Show line ages and birth commits for one file:

git hot -q --format '{days(age)} {hash[:7]} {line}' -- src/main.py

Reconstruct all source files with churn prefixes below a directory:

git hot --dir hot-tree HEAD

Output

Without a path, git hot prints one line per current source file, sorted by path. The default columns are:

  • maximum live-line churn in the file
  • median changed-line lifetime in days
  • median live-line age in days
  • repository path

With a path, git hot prints the reconstructed contents of that file. By default each line is preceded by its churn count.

Use --color always or --color never to control color output. Automatic coloring can rank lines by churn, age, or lifetime:

git hot --color-domain age -- src/main.py

Formatting

Use --format to customize file or line output with a restricted Python f-string expression. The available fields depend on whether repository-wide file metrics or selected-path line output is being produced.

Examples:

git hot --format '{max(churn):5d} {days(median(line_age)):5d} {path}'
git hot --format '{days(age)} {hash[:7]} {line}' -- src/main.py

Common helpers include days, max, min, median, mean, quartile_rank, color, and color_reset.

For the complete list of format fields and options, see:

man git-hot

or read the git-hot manual page.

Requirements

git-hot expects to run inside a Git repository. Alternatively, the Git repository can be passed to the git command using the --git-dir option. Internally, it invokes Git commands such as git log, git show, and git diff, and uses rename and copy detection.

Binary files and deleted files are skipped in file-metric output.

Installing From Source

Building from source requires Python 3.10 or later and a Rust toolchain with rustc, because daglp is compiled during installation.

uv sync --group dev
uv pip install -e .
uv run python -m unittest discover -s . -p 'test*.py'
uv run --group dev ruff check .

Run the full Python integration test suite on Unix-like systems with:

make test-python

This rule exercises the Git history fixtures, shell scripts, daglp, and the Python command-line interface. It depends on Bash and standard Unix tools such as sort and diff, so CI runs it only on Linux.

Build a source distribution locally with:

uv build --sdist

Reinstall updated Python source code with:

pipx uninstall git-hot
pipx install .

Platform wheels are built in CI through cibuildwheel, which smoke-tests the installed git-hot and daglp commands and runs the portable Python unit tests against each wheel on Linux, Windows, and macOS.

Research Tools

This repository also contains research-oriented source tools used for fine-grained code lifetime analysis, including lifetime.py, difflog.sh, tokenize.pl, and the top-level daglp.rs. They are kept in source form for reproducibility and experimentation, but the installable package exposes only git-hot and daglp.

For historical and research context, see lifetime-tools.md.

  • Diomidis Spinellis. Tracking code churn with Git. IEEE Software, 43(5):17–21, September 2026. doi:10.1109/ms.2026.3703113
  • Saleha Muzammil, Mughees Ur Rehman, Zoe Kotti, and Diomidis Spinellis. Source code hotspots: A diagnostic method for quality issues. In Proceedings of the 23rd International Conference on Mining Software Repositories, MSR '26, pages 1–13. ACM, April 2026. doi:10.1145/3793302.3793334
  • Diomidis Spinellis, Panos Louridas, and Maria Kechagia. Software evolution: The lifetime of fine-grained elements. PeerJ Computer Science, 7:e372, February 2021. doi:10.7717/peerj-cs.372

License

git-hot is distributed under the Apache License 2.0. See LICENSE.

Release files for git-hot 0.11.1

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-hot 0.11.1
File Size Uploaded
git_hot-0.11.1.tar.gz 32.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for git-hot 0.11.1
File
git_hot-0.11.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
git_hot-0.11.1-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
git_hot-0.11.1-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
git_hot-0.11.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 3.0 MB

Release files / git_hot-0.11.1.tar.gz

Download URL git_hot-0.11.1.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3cf4715f62fdbbbdd0c86ec1cf465ac6873fbfe7a01ac6e8f813bca42201b9e6
BLAKE2b-256 checksum
How to use checksums
22afa0ea77edb4ad1ab0c75e5944d71f82ed7811e0d2687a689321185523215c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / git_hot-0.11.1-py3-none-win_amd64.whl

Download URL git_hot-0.11.1-py3-none-win_amd64.whl
Size 456.3 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
bcc92836cf7935f93208f8ebc3dee8b57151590b9194c2ae928ee4cba887655a
BLAKE2b-256 checksum
How to use checksums
bba3b744dcecb65203721f0e81c4a546c2fb33e2db58029fb6d79cf2b0e2edb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / git_hot-0.11.1-py3-none-manylinux_2_28_x86_64.whl

Download URL git_hot-0.11.1-py3-none-manylinux_2_28_x86_64.whl
Size 1.2 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a243487d51a0861ea79f0bfc9018fc47f6dff6ee773344d7ec70d96061046f87
BLAKE2b-256 checksum
How to use checksums
1dd6ca021deb8fadbb3f86f873a6432e7c9c1b32a8fd3dd0e519c1b7e56a26a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / git_hot-0.11.1-py3-none-manylinux_2_28_aarch64.whl

Download URL git_hot-0.11.1-py3-none-manylinux_2_28_aarch64.whl
Size 1.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b62e3ca162a97c5596551cf6ed9a5d536f543704eb34805144d56a9cc42a41fc
BLAKE2b-256 checksum
How to use checksums
eb7449f30e8067ec8a5f4216631dc7bd6b84ce2c763a7ffffdc803fea19e1807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / git_hot-0.11.1-py3-none-macosx_11_0_arm64.whl

Download URL git_hot-0.11.1-py3-none-macosx_11_0_arm64.whl
Size 238.7 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4838b3bcb5bac52a4024b6456eaccec5333eca1854fd9461646af092a37f1e9b
BLAKE2b-256 checksum
How to use checksums
b40238eb3d31d9ba7759bc45627c1527a6cf636a6d7a46865264396b32d20b9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.11.1 This release

5 release files

0.11.0

5 release files

0.10

5 release files

0.9

5 release files

0.6

5 release files

0.1

1 release file

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