【发布时间】:2018-03-19 16:51:30
【问题描述】:
所以我和其他一些程序员在一个团队中,需要在我们的 git 存储库中获取每个作者的代码行数。这不仅仅意味着作者修改的行,因为这将包括空白行和注释行。理想情况下,我可以创建一个仅包含特定作者提交的新分支(我自己为--author="BtheDestroyer"),然后使用cloc 分别获取注释行数和代码行数。我试过使用
git log --author="BtheDestroyer" --format=%H > mycommits
git checkout --orphan mycommits
tac mycommits| while read sha; do git cherry-pick --no-commit ${sha}; done
然而,在最后一行中,我收到大量以下错误:
filepath: unmerged (commit-id-1)
filepath: unmerged (commit-id-2)
error: your index file is unmerged.
fatal: cherry-pick failed
我也不确定这是否最终会通过过程中的其他提交进行快进。有什么想法吗?
【问题讨论】:
标签: git git-branch author lines-of-code cloc