Skip to content

Instantly share code, notes, and snippets.

@eric-wieser
Forked from rabbidrabbit/rename.sh
Created March 13, 2012 19:40
Show Gist options
  • Save eric-wieser/2031070 to your computer and use it in GitHub Desktop.
Save eric-wieser/2031070 to your computer and use it in GitHub Desktop.
Rewrites the SR repos history
#!/bin/bash
git filter-branch -f --tag-name-filter cat --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_NAME" = "ew3" ]
then
cn="Eric Wieser"
cm="[email protected]"
fi
if [ "$GIT_AUTHOR_NAME" = "ew3" ]
then
an="Eric Wieser"
am="[email protected]"
fi
if [ "$GIT_AUTHOR_NAME" = "ew3" ] && [ "$GIT_COMMITER_NAME" = "Apache" ]
then
cn="Eric Wieser"
cm="[email protected]"
an="Eric Wieser"
am="[email protected]"
fi
if [ "$GIT_COMMITTER_NAME" = "lt1" ]
then
cn="Louis Taylor"
cm="[email protected]"
fi
if [ "$GIT_AUTHOR_NAME" = "lt1" ]
then
an="Louis Taylor"
am="[email protected]"
fi
if [ "$GIT_AUTHOR_NAME" = "lt1" ] && [ "$GIT_COMMITER_NAME" = "Apache" ]
then
cn="Louis Taylor"
an="Louis Taylor"
cm="[email protected]"
am="[email protected]"
fi
if [ "$GIT_COMMITTER_NAME" = "nd1" ]
then
cn="Nic Dart"
cm="[email protected]"
fi
if [ "$GIT_AUTHOR_NAME" = "nd1" ]
then
an="Nic Dart"
am="[email protected]"
fi
if [ "$GIT_AUTHOR_NAME" = "nd1" ] && [ "$GIT_COMMITTER_NAME" = "Apache" ]
then
cn="Nic Dart"
an="Nic Dart"
cm="[email protected]"
am="[email protected]"
fi
if [ "$GIT_COMMITTER_NAME" = "jl3" ] || [ "$GIT_COMMITTER_NAME" = "rabbidrabbit" ]
then
cn="Jonathan Laver"
cm="[email protected]"
fi
if [ "$GIT_AUTHOR_NAME" = "jl3" ] || [ "$GIT_AUTHOR_NAME" = "rabbidrabbit" ]
then
an="Jonathan Laver"
am="[email protected]"
fi
if [ "$GIT_AUTHOR_NAME" = "jl3" ] && [ "$GIT_COMMITER_NAME" = "Apache" ]
then
cn="Jonathan Laver"
an="Jonathan Laver"
cm="[email protected]"
am="[email protected]"
fi
export GIT_AUTHOR_NAME="$an"
export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_NAME="$cn"
export GIT_COMMITTER_EMAIL="$cm"
' -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment