git提交频率的punchcard生成器
git-punchcard的Python项目详细描述
简单的git punchcard实用程序,灵感来自git-punchcard-plot,但已重写 对于带有matplotlib的python3。
安装
从PyPI安装或升级,如下所示:
pip install --user --upgrade git-punchcard
另外,确保$HOME/.local/bin位于$PATH中。
为了避免与其他软件包冲突,我建议安装到 隔离环境,例如使用pipx:
pipx install git-punchcard
用法
基本用法:
git punchcard
其他参数可以指定如下:
git punchcard [<input path>...][<options>][--][<log options>][<revision range>][-- <path>...]
有关可用选项的更多帮助,请键入:
git punchcard -h # [options] git help log # [log options] git help gitrevisions # [revision]
选项
最常见的内置选项是:
# use a fixed timezone for all commits: git punchcard --timezone CET git punchcard --timezone Europe/Berlin git punchcard --timezone UTC+02:30 # show punchcard with specified y/x axes: git punchcard -p year/month git punchcard -p wday/month # histogram with specified x axis: git punchcard -p /wday # set the directory of the git repository (multiple allowed): git punchcard /path/to/repo # analyze all repositories in ~/dev: git punchcard ~/dev/*/.git # read commit dates from stdin: git punchcard - # show a github-like punchcard plot with grid: git punchcard --grid
默认情况下,每个提交的本地时区用于绘图。如果设置 固定时区,应根据时区名称指定(例如 CET或Europe/Berlin,但也可以通过iso 3166国家代码给出 或国家名称(如果时区不明确,我们将选择第一个条目)。
Git日志选项
此外,您可以将git log理解的任何选项传递给例如。 限制提交的范围并限制由某个 作者:
# 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: git punchcard --follow -- README.rst docs # show at which times, people like to merge: git punchcard --merges
高级示例
跟踪多年来提交活动的演变:
for year in {2016..2019};do git punchcard -o $year.png --title $year\ --since 1.1.$year --until 31.12.$yeardone