scripts: add git email fixer

This commit is contained in:
Bruno BELANYI 2021-03-06 16:19:16 +00:00
parent 5a6853751f
commit bfb7aa2e41

17
change-git-email.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --env-filter '
OLD_EMAIL="brunobelanyi@gmail.com"
CORRECT_NAME="Bruno BELANYI"
CORRECT_EMAIL="bruno@belanyi.fr"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]; then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]; then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d