安装
npm install -g git-time
我最近完成了一个项目,让我一次坐着工作多个小时。
例如,我可能从上午8点开始,直到下午2:30。我一开始就进行提交,然后在离开前进行提交。
我想估算我在这个项目上工作了多少小时。
我本来打算仔细检查提交内容并手动解决,但是git Web界面只是给出了模糊的时间戳,例如“ 2个月前编写的”。
有人知道任何通过git计算小时数的第三方应用程序吗?
或者希望提供有关下一步尝试的任何指示?
谢谢!
我已经创建了git-hours工具来估算您所描述的git存储库所花费的时间。
计算小时数的算法非常简单而且愚蠢。请参阅文档以了解其工作原理:https://github.com/kimmobrunfeldt/git-hours#how-it-works
例如,估计在Bootstrap上花费的时间:
➜ bootstrap git:(master) git hours
{
...
"total": {
"hours": 9959,
"commits": 11470
}
}
请注意,该信息不够准确,无法用于计费。它给出了项目大小的粗略概念。
npm install git-hours -g
然后,运行:
cd /to/your/local/repository
git hours ; # total of all time
git hours --since yesterday # since yesterday
也有一个小的Python脚本:coded4。设置:
git clone git://github.com/Xion/coded4.git
cd coded4
./setup.py develop
用途:
cd /to/your/local/repository
coded4 .
并提供可用选项的粗略概念:
coded4 -h
usage: coded4 [-h] [--repo TYPE] [--format FORMAT] [--since DATE]
[--until DATE] [--cluster-algo ALGO] [--approx-algo ALGO]
[--epsilon MINUTES]
DIRECTORY
还有:git_time_extractor和a blog-post about getting time estimates using git-pandas。
[在估计编码时间之前,Gitential对作者进行重复数据删除,并过滤掉被视为离群值的代码更改,以减少git数据的噪声。
您可以将Assembla Space与(至少)Git存储库(Assembla或Github或Bitbucket的)和时间工具(以及特殊格式的Git的提交消息)一起使用,并从“时间”选项卡中获得“ [由自定义期间集成]”时间报告。无论如何, 每次提交]的时间跟踪是您自己的任务,没人知道,您在两次连续提交之间实际工作了多少]] 用法git-time <path>
<path>
应该是有效的Git存储库根路径。
您可以在这里获得它:git-estimate
该代码是用纯文本编写的,并使用go-git读取存储库的提交。
用法
git-estimate -repo=/path/to/repo
这将使用默认设置来计算在指定路径上回购所花费的时间。
git-estimate -h -baseline float baseline value for session estimate (default 2) -estimate string estimation method. Accepted values are "session" and "day". (default "session") -json if true will output estimates in JSON format -repo string git repository path. If no flag is specified the current folder is assumed (default ".")
您可以在这里获得它:git-estimate
该代码是用纯文本编写的,并使用go-git读取存储库的提交。
用法