博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
git --git-dir_估计使用git-pandas在项目上花费的时间
阅读量:2520 次
发布时间:2019-05-11

本文共 3634 字,大约阅读时间需要 12 分钟。

git --git-dir

I stumbled across a conversation recently on the (a pretty good public slack group for Atlanta area software folks) about mostly taxes, but nestled in the middle was this project: . In the past I’ve noticed a kind of of git related open source projects among Atlanta developers, I’m not sure if that says more about Atlanta or git’s abstruseness.

最近,我在 (对于亚特兰大地区软件人员来说是一个相当不错的公共松弛团体)上偶然发现了有关的对话,但中间是这个项目: 。 过去,我注意到亚特兰大开发人员中与git相关的开放源代码项目 ,我不确定这是否能进一步说明亚特兰大或git的深刻性。

Anyway, git time extractor is one of a few projects that will rip through your commit history in a given repository and piece together an estimate of how much time was spent writing the code behind them.  This can be useful for taxes, general time tracking, reporting or just plain old vanity.  The 3 projects I know of that do this are:

无论如何,git time extractor是将翻阅给定存储库中提交历史的几个项目之一,并估算出在其背后编写代码所花费的时间。 这对于税收,常规时间跟踪,报告或只是普通的虚荣表很有用。 我知道的3个项目是:

I though it would make a nice feature for , which I’ve written about here a .  I just released version 1.0.3 of that library, so you can get the new functionality by installing it with:

我虽然它将使一个很好的功能 ,这是我在这里写了一个 。 我刚刚发布了该库的1.0.3版,因此您可以通过以下方式安装该新功能:

pip install -U git-pandas

For a deeper dive into how the algorithm itself works, kimmobrunfeldt really did a great job in his README of git-hours, so check it out here: 

为了更深入地了解算法本身的工作原理,kimmobrunfeldt在git-hours的自述文件中确实做了出色的工作,因此请在此处查看: :

For an example of that in git-pandas, we will make a Repository object for the git-pandas repo itself, and calculate the hours spent on it’s python files in the master branch, excluding tests, and assuming 30 minutes or so for a lone commit:

例如,在git-pandas中,我们将为git-pandas存储库本身创建一个Repository对象,并在master分支中计算花费在其python文件上的时间(不包括测试),并假设30分钟左右承诺:

import osfrom gitpandas.repository import Repository# get the path of this repopath = os.path.abspath('../../git-pandas')# build an example repository object and try some things outignore_dirs = ['tests']r = Repository(path, verbose=True)# get the hours estimate for this repository (using 30 mins per commit)he = r.hours_estimate(    branch='master',    grouping_window=0.5,    single_commit_hours=0.5,    limit=None,    extensions=['py'],    ignore_dir=ignore_dirs)print(he)

Which yields two rows (because apparently I can’t spell my name right on one computer):

它产生两行(因为显然我不能在一台计算机上拼写我的名字):

committer      hours0  Will McGinnis  19.4544441  Will Mcginnis   9.275556

If we were to change our single_commit_hours from 30 minutes to 45 minutes we get:

如果我们将single_commit_hours从30分钟更改为45分钟,则会得到:

committer      hours0  Will McGinnis  28.7680561  Will Mcginnis  13.275556

So not quite an exact science, but pretty cool.  You can, as always, use this function on a Repository object (which corresponds to a single git repo) or a ProjectDirectory (which corresponds to a collection of repos).  The interface between the two is, as always, the exact same.  Another potentially neat thing to do would be to run it on your GitHub.com profile and all public repositories in it, which is easy to set up:

因此,这不是一门确切的科学,而是很酷的。 与往常一样,您可以在Repository对象(对应于单个git repo)或ProjectDirectory(对应于回购的集合)上使用此功能。 两者之间的接口一如既往地完全相同。 可能要做的另一件事是在GitHub.com个人资料及其中的所有公共存储库上运行它,这很容易设置:

g = GitHubProfile(username='wdm0006', ignore_forks=True, verbose=True)g.hours_estimate(branch='master', by='repository')

For a project directory or github profile, you can chose to aggregate the output dataframe by committer, by repository, or use the default value of None to return the table unmodified.

对于项目目录或github概要文件,您可以选择按提交者,按存储库聚合输出数据框,或使用默认值None返回未修改的表。

Check out the source on github:

在github上查看源代码:

翻译自:

git --git-dir

转载地址:http://wgqwd.baihongyu.com/

你可能感兴趣的文章
codevs 1160 蛇形矩阵
查看>>
在outlook中查找Skype的聊天记录
查看>>
netsh命令
查看>>
nginx set变量后lua无法改值
查看>>
baseAdapter
查看>>
别让你妈知道!
查看>>
JAVA设计模式之迭代子模式
查看>>
Java程序生成exe可执行文件
查看>>
什么是blob,mysql blob大小配置介绍
查看>>
模运算的规则
查看>>
CSS样式布局入门介绍,非常详尽
查看>>
android app崩溃日志收集以及上传
查看>>
3、VS2010+ASP.NET MVC4+EF4+JqueryEasyUI+Oracle项目开发之——用户登录
查看>>
面试记-(1)
查看>>
压力测试 相关
查看>>
android update automatically ( android 自动升级)
查看>>
session cookie
查看>>
POJ 1222 EXTENDED LIGHTS OUT(翻转+二维开关问题)
查看>>
【BZOJ-4059】Non-boring sequences 线段树 + 扫描线 (正解暴力)
查看>>
几种简单的负载均衡算法及其Java代码实现
查看>>