0
因此,我与一些其他程序员一起在一个团队中,需要在我们的git存储库中为每个作者获取一行代码数。这不仅仅意味着作者修改过的行,因为这将包括空行和注释行。理想情况下,我可以创建一个仅包含特定作者提交的新分支(我自己的--author="BtheDestroyer"
),然后使用cloc
分别获取注释行数和代码行数。我的最后行期间使用在git存储库中为每个作者计算代码行数
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
我也不能肯定是否会最终通过其他提交快进正在进行中。有任何想法吗?