org_heigl/captainhook_addtime
Composer 安装命令:
composer require org_heigl/captainhook_addtime
包简介
Add the time since your last commit to the commit-message
README 文档
README
A small addition to CaptainHook that will add the time since your last commit to your commitmessage
That way you can use a different tool to extract the times you spent on a project from the commitmessages
To be sure that the time is added to each commit there is also a check that can be used to verify that a time is added.
Installation
Install this package using composer
composer require --dev heiglandreas/captainhook_addtime
Usage
Adding time
In your captainhook.json file you can then add this hook to your prepare-commit-msg-hooks:
{
"prepare-commit-msg" : {
"enabled" : true,
"actions" : [{
"action" : "\\Org_Heigl\\CaptainHook\\Hooks\\AddTime\\AddTimeAction",
"options" : {
"fuzziness": "\\Org_Heigl\\CaptainHook\\Hooks\\AddTime\\Fuzzier\\TenMinutesCeiling"
}
}]
}
}
This will round up to the next 10 minutes.
Verifying time is added
To make sure that each commit contains a time you can add this to your captainhook.json-file:
{
"commit-msg": {
"enabled": true,
"actions": [{
"action": "\\Org_Heigl\\CaptainHook\\Hooks\\AddTime\\EnsureTime",
"options": {}
}]
}
}
This will require each commit-message to contain something like the following on one line:
Time: 12h15m
There can be whitespace before or after the content but the 'h' and 'm' needs to be lower case and there must not be any whitespace in that time-information.
You can ommit the hours or the minutes. (Ommiting both doesn't really make sense (-; )
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-12-25
