Skip to main content

A tool to generate a heatmap of your git commits

Project description

git-heatmap

Shows a heatmap for your Git repositories.

Screenshot

Install

$ pip install git-heatmap

Usage

Usage: git-heatmap [OPTIONS]

Options:
  -r, --repo TEXT       Path to git repository (can be relative)
  -a, --author TEXT     Author email (default all authors)
  -b, --branch TEXT     Branch (default all branches)
  -s, --start TEXT      Start date (YYYY-MM-DD, defaults to current year
                        start)
  -e, --end TEXT        End date (YYYY-MM-DD, defaults to current year end)
  -c, --character TEXT  Character to use for heatmap (defaults to ▧)
  -sh, --shade TEXT     Color to use for heatmap (defaults to 0;255;0)
  --help                Show this message and exit.

Examples

Run git-heatmap ...

# in a directory that's already a git repository
$ git-heatmap

# on a repository elsewhere
$ git-heatmap -r /path/to/repo

# limit by author email
$ git-heatmap -a me@myself.com

# pick a specific branch
$ git-heatmap -b main

# pick multiple branches
$ git-heatmap -b main -b develop

# start from date
$ git-heatmap -s 2023-02-01

# end on date
$ git-heatmap -s 2023-02-28

# change characters
$ git-heatmap -c '●'

# change colors
$ git-heatmap -sh "255;255;0"

FAQ

Why?

Mostly fun, I like things cli. It's also rather annoying that github's heatmap only targets the primary branch of a repository.

Does this count any contribution other than commits?

No, this is purely commits, including merge commits (I think! :-))

What branch does it pick if I didn't specify one?

All branches!

But commits are the same in more than one branch!

Yes, that's why it only counts unique commit hashes.

Where's the damn month row on top?

I got lazy, please submit a PR. The code already calculates where the month abbreviation should be, someone just needs to implement it (See comments)

This will be slow on large repositories!

Yes, more than likely. I'm using gitpython and didn't really dig much into the documentation. The date and author filters are in python, not delegated to git. If you have the solution, please submit PR.

Why not make this a git extension?

That was the original plan, but we are where we are...

Can I...

Yes you can. Remember this is meant as tiny fun project.

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-heatmap-0.0.5.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

git_heatmap-0.0.5-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file git-heatmap-0.0.5.tar.gz.

File metadata

  • Download URL: git-heatmap-0.0.5.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for git-heatmap-0.0.5.tar.gz
Algorithm Hash digest
SHA256 8b3d70d658959cc6f7d371f5b6c4d4587aa5c49b5c05d968c2931ec1c425f8d7
MD5 79644b39a4b135dacf69276dcd5c655f
BLAKE2b-256 9ccb436e44c8f249bc193dfe3dd518eeca0ca81c371536b962fd4de8a54bd213

See more details on using hashes here.

File details

Details for the file git_heatmap-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: git_heatmap-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for git_heatmap-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b3d04ad4bcd1c4864bdad155426c303d8afb0de688287f37529e2e0a562e4773
MD5 e7c364319a2474b78273fd7f3e96b896
BLAKE2b-256 24e64aaa7ba7539ce7af1d11109e3dd64e13379dd291a6faf60e57fab56aec66

See more details on using hashes here.

Supported by

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