TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Git script to measure contributor LOCs

14 点作者 beghbali将近 13 年前

6 条评论

zalew将近 13 年前
and for mercurial<p><a href="http://mercurial.selenic.com/wiki/ChurnExtension" rel="nofollow">http://mercurial.selenic.com/wiki/ChurnExtension</a><p>user LOC<p><pre><code> $ hg churn -t users@email 30454 **************************************************** </code></pre> users' changesets<p><pre><code> $ hg churn -c user1 65 **************************************************** user2 41 ********************************* user3 2 **</code></pre>
amatus将近 13 年前
For those of us not on BSD:<p><pre><code> git ls-files -z | xargs -0 -n1 -E'\n' git blame --date short -wCMcp | perl -pe 's/^.*?\((.*?) +\d{4}-\d{2}-\d{2} +\d+\).*/\1/' | sort | uniq -c | sort -rn</code></pre>
prisonguard将近 13 年前
Is LOC still a worthwhile metric to estimate developer productivity?
评论 #4297511 未加载
aidenn0将近 13 年前
git blame -p is going to be easier to parse<p>example:<p><pre><code> git blame --line-porcelain |awk 'BEGIN { ORS=" " } $1=="author" {for (i=2;i&#60;=NF;++i) print $i; printf("\n")}'|sort|uniq -c|sort -n </code></pre> better:<p><pre><code> git ls-files -z|xargs -0 -n1 git blame --line-porcelain|awk '$1=="author" {auth=$2; for(i=3;i&#60;=NF;++i) auth=auth " "$i; counts[auth]+=1} END {for(a in counts) print counts[a],a}'</code></pre>
kscaldef将近 13 年前
Much more extensive and detailed information is provided by <a href="https://github.com/hoxu/gitstats" rel="nofollow">https://github.com/hoxu/gitstats</a>
esharef将近 13 年前
Very cool -- thanks for sharing.