Skip to content

Commit 835e33b

Browse files
committed
Added script to count lines of code changed per committer email address, because GitHub removed that feature from web UI.
Thanks to bgwines and xet7 !
1 parent 8ba3a05 commit 835e33b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# At 2024, GitHub removed feature of counting lines of code from
4+
# https://github.com/wekan/wekan/graphs/contributors
5+
# "Contributions to main, line counts have been omitted because commit count exceeds 10,000."
6+
#
7+
# This code counts lines of code per email address:
8+
# https://github.com/orgs/community/discussions/89886#discussioncomment-8650093
9+
10+
if [ $# -ne 1 ]
11+
then
12+
echo "Syntax to count lines of code per committer, by email address:"
13+
echo " ./releases/count-lines-of-code-per-committer.sh [email protected]"
14+
echo "Example result at 2024-03-08:"
15+
echo " added lines: 4594802, removed lines: 4416066, total lines: 178736, added:deleted ratio:1.04047"
16+
exit 1
17+
fi
18+
19+
git log --author=$1 --pretty=tformat: --numstat | awk '{ adds += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s, added:deleted ratio:%s\n", adds, subs, loc, adds/subs }' -

0 commit comments

Comments
 (0)