SLOC in git declaration
1 answer
Use --numstat
(for file changes) or --shortstat
(for sum of changes) as an argument git show
, git log
or git diff-tree
.
For example, in bash:
while read sha; do
git diff-tree --shortstat $sha $sha^
done
Note that the various diffstat flags can be passed to almost any git command that checks a commit, but they are only documented in the git-diff-tree man page .
+1
source to share