punchcard generator for git commit frequencies
Project description
Simple git punchcard utility, inspired by git-punchcard-plot but rewritten for python3 with matplotlib.
Installation
The pragmatic way: The script can be obtained from PyPI:
pip install --user git-punchcard
Also, make sure that ~/.local/bin is in $PATH. If it is not there, add the following lines to .bashrc or .zshrc:
PATH=$PATH:$HOME/.local/bin
The elegant way: Get pipx and then run pipx install git-punchcard to install into an isolated environment.
The crude way: Alternatively, simply drop the git_punchcard.py script into ~/.local/bin, rename to git-punchcard and add the folder to PATH.
Usage
The syntax of the command is as follows:
git punchcard [options] [-- [log options] [revision range] [-- pathes]]
To get a list of available options, type:
git punchcard --help # for our own options
git help log # for possible git log options
git help gitrevisions # for revision range
The most important options are:
Show a github-like punchcard plot with grid:
git punchcard --grid
By default, the author’s local timezone is used for the plot. In order to use a fixed timezone for all commits, you have to specify a --timezone argument, e.g.:
git punchcard --timezone CET
Set the directory of the git repository as follows:
git punchcard -C /path/to/repo
Advanced examples
You can pass additional git log options after a --. This can for example be used to restrict the range of commits and/or limit to commits performed by a certain author:
# include only commits by specific author:
git punchcard -- --author=myself
# consider only only the 20 commits:
git punchcard -- master~20..master
# commits within a certain time frame:
git punchcard -- --since="1 year ago" --until=now
# show at which times a certain file/folder is usually edited:
# (the second -- is for git log):
git punchcard -- --follow -- src
git punchcard -- --follow -- docs
# show at which times, people like to merge:
git punchcard -- --merges
You can even to restrict to certain pathes within the git repository as follows (note the second -- is passed to and needed for the git log command line):
git punchcard -- -- README.rst
Track evolution of commit activity over the years:
for year in {2016..2019}; do
git punchcard -o $year.png --title $year \
-- --since 1.1.$year --until 31.12.$year
done
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for git_punchcard-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c18ccf4af4fb97f209ec7101f2f2a387d60dffeafe19a21dc0853ceb7385f18 |
|
MD5 | ff7ee72e7cbcd385d018ac9f52907989 |
|
BLAKE2b-256 | f5155192e3dc2b96f2ba070663a71d4c1acc429a820d4e890fb75da307f02cdc |