Created
October 22, 2021 22:08
-
-
Save liskin/7b78eba396024d4f56fa217867e2a3a8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
set -eu -o pipefail | |
shopt -s lastpipe | |
repo=~/src-haskell/xmonad-tmp | |
function mailmap-diff { | |
diff -au \ | |
<(cd "$repo"; git shortlog --summary --email) \ | |
<((cd "$repo"; git log --pretty=short --no-mailmap) | (git shortlog --summary --email)) | |
} | |
sedscript='' | |
wc -l "$repo"/.mailmap | read -r lines _ | |
for l in $(seq 1 $lines); do | |
sedscript2="${sedscript}${l}d;" | |
sed -e "$sedscript2" <"$repo"/.mailmap >.mailmap | |
if mailmap-diff >/dev/null; then | |
sedscript="$sedscript2" | |
fi | |
done | |
sed -e "$sedscript" <"$repo"/.mailmap >.mailmap-clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment