git提交频率的打孔卡生成器
项目描述
git-punchcard
简单的git打孔卡实用工具,受git-punchcard-plot启发,但用matplotlib重新编写,用于python3。
安装
按照以下方式从PyPI安装或升级
pip install --user --upgrade git-punchcard[gui]
此外,请确保$HOME/.local/bin已添加到$PATH中。
为了避免与其他包冲突,我建议在一个隔离环境中安装,例如使用pipx
pipx install git-punchcard[gui]
用法
基本用法
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 log选项
此外,您还可以传递任何由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.$year
done
更改
2.0.4
日期:2021年10月28日
添加pyqt作为可选的gui依赖项,例如:pip install git-punchcard[gui]
从Travis CI迁移到GitHub Actions
2.0.3
日期:2019年10月31日
在源分发中包含许可证文件
2.0.2
日期:2019年10月31日
自动部署
设置和测试中的更改
2.0.1
日期:2019年3月26日
修复:如果没有用户传入输入路径,则默认为当前目录
2.0.0
日期:2019年3月26日
将-C转换为位置参数,移除-C选项
允许多个输入文件
允许传入带有git log输出的-和文件作为输入文件
删除对docopt的过时依赖
允许传入国家代码和名称而不是时区(在存在歧义的情况下使用第一个可用的时区)
不区分大小写地匹配时区
显示git命令和提交次数
对于常见错误,显示错误消息而不是跟踪记录
1.4.0
日期:2019年3月26日
学习--period Y/X参数来指定Y/X轴
可以通过留空一个轴来绘制直方图
将-v视为--version的别名
1.3.0
日期:2019年3月21日
现在直接传递日志选项,而不使用--,与其他选项相同
取消对docopt的依赖
1.2.0
日期:2019年3月21日
修复在未调用运行时依赖项时setup.py异常
仅在需要时导入pytz
学习一个-C DIR参数来传递git仓库的路径
学习一个--version参数来显示脚本版本
修复同时传递选项和git选项时的错误
转换为模块,并使用setuptools entry_points生成脚本
1.1.0
日期:2019年3月11日
添加--title参数
项目详情
git-punchcard-2.0.4.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c24855cf53140396e723883e95f5e9b9732f93fbbd38cd64e8bb2dc102d3da76 |
|
MD5 | d967c9197b1f40ed1c3999c78df6e4dd |
|
BLAKE2b-256 | f89df2c051e4956f84c45a344642760815c9b3abdcd7afcebff8fc58b74581c4 |
git_punchcard-2.0.4-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | b5e1518427395b5016fd08d5487ee30e8424cb7ea5afbb9e0f58aa188b823134 |
|
MD5 | 419af0ea1904aabbc93bdc838a960167 |
|
BLAKE2b-256 | 102041bb21acf316bb301e0b9c38b51e514349ed20539032e7bfc9fc5b37b832 |