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

Built distributions (wheels)

Table of built distributions (wheels) for git-hot 0.11.0
File
git_hot-0.11.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
git_hot-0.11.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
git_hot-0.11.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
git_hot-0.11.0-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.0.tar.gz

Download URL git_hot-0.11.0.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ca3f666b437d8b9a665f0746a7ebbcc4b660ac3851b91881046bc7a8934594ac
BLAKE2b-256 checksum
How to use checksums
9b88d661bfac789e1b3da585f68c0cd3a5a695106075fc7534c731a353d99c35
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.0-py3-none-win_amd64.whl

Download URL git_hot-0.11.0-py3-none-win_amd64.whl
Size 448.4 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
0b8db02f90c30516006e885f111a0633776a0e8a3820d22cd2ff84c8a7e920fc
BLAKE2b-256 checksum
How to use checksums
3a97d9782b90805a255e03aa3443eb67c83effc32945d4394dd6139eb480a516
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.0-py3-none-manylinux_2_28_x86_64.whl

Download URL git_hot-0.11.0-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
90a330dabc6788fac4797ffe2afedde258df54fc3010dd969ba22d98e1176589
BLAKE2b-256 checksum
How to use checksums
5e6e56bafe80161c0ebb1fbb732f6ec72ec8d3019a5e2464141037767a2a661b
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.0-py3-none-manylinux_2_28_aarch64.whl

Download URL git_hot-0.11.0-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
9a1c72fa8ef97b4561e5d7b2eb050f7e635d4d4eece030003a393e3cea388290
BLAKE2b-256 checksum
How to use checksums
6ff23a0a7218825839de601bd60f5bde8196dd72031190617f68ba4a6922ab01
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.0-py3-none-macosx_11_0_arm64.whl

Download URL git_hot-0.11.0-py3-none-macosx_11_0_arm64.whl
Size 238.6 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
743377af4fed949a9a668a18dd2cb48173202882fac7e3f8f698e71d1f5be4dc
BLAKE2b-256 checksum
How to use checksums
ce1d43e40b0331b3852fc35211e45e7febba52e8f8e4b82802b087f5a864e283
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

0.11.1

5 release files

This release

0.11.0 This release

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