Created
July 29, 2011 13:10
-
-
Save alexbevi/1113777 to your computer and use it in GitHub Desktop.
git filter-branch to rewrite asylum history to prepend "ASYLUM: " to all entries that need it
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
git filter-branch -f --msg-filter ' | |
i=0 | |
while read line | |
do | |
if [ $i -eq 0 ]; | |
then | |
if expr "$line" : ".*ASYLUM:.*" > /dev/null; | |
then | |
echo "$line" | |
else | |
echo "$line" | sed "s/^/ASYLUM: /g" | |
fi | |
else | |
echo "$line" | |
fi | |
i=1 | |
done ' f5b266b~1..HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// how to remove myself as the committer
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "Alex Bevilacqua" ];
then
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME";
GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL";
git commit-tree "$@";
else
git commit-tree "$@";
fi' f5b266b~..HEAD