Last active
January 10, 2024 14:29
-
-
Save amicojeko/0e05946927ff159ebb0dc13b2243266f to your computer and use it in GitHub Desktop.
Git deleted lines report per contributor
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
#!/bin/bash | |
# Verify is this is a git repo | |
if ! git rev-parse --git-dir > /dev/null 2>&1; then | |
echo "Questo non è un repository Git." | |
exit 1 | |
fi | |
IFS=$'\n' # Change the line separator to avoid breaking lines on spaces | |
# Contributors list | |
contributors=$(git log --format='%aN' | sort -u) | |
for contributor in $contributors; do | |
echo -n "$contributor: " | |
git log --author="$contributor" --pretty=tformat: --numstat | | |
awk '{deleted += $2} END {print deleted}' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment