Created
October 27, 2023 14:05
-
-
Save xring/3fac3a63673147a6a47cc0dcbd4b022e to your computer and use it in GitHub Desktop.
count user code lines in git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --since="2022-01-01" --until="2022-12-31" --numstat --pretty="%an" | | |
awk ' | |
{ | |
if (NF == 1) author = $0 | |
else if (NF > 1) { | |
added[author] += $1; | |
removed[author] += $2; | |
} | |
} | |
END { | |
for (a in added) { | |
print a ": +", added[a], "- ", removed[a]; | |
} | |
}' | sort -k3 -nr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment