Skip to content

Instantly share code, notes, and snippets.

@amicojeko
Last active January 10, 2024 14:29
Show Gist options
  • Save amicojeko/0e05946927ff159ebb0dc13b2243266f to your computer and use it in GitHub Desktop.
Save amicojeko/0e05946927ff159ebb0dc13b2243266f to your computer and use it in GitHub Desktop.
Git deleted lines report per contributor
#!/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