Created
May 1, 2012 12:27
-
-
Save daniel-fanjul-alcuten/2567673 to your computer and use it in GitHub Desktop.
bup reset
This file contains 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
#!/bin/bash | |
cd ~/.bup && { | |
git for-each-ref refs/heads/ --shell --format ' | |
echo -n %(refname)... | |
commit=$(echo empty | git commit-tree `git mktree < /dev/null`) | |
for i in `git rev-list --since="2 week ago" --date-order --reverse %(refname)`; do | |
commit=$(git log -1 --pretty=format:%%B $i | GIT_AUTHOR_NAME=`git log -1 --pretty=format:%%an $i` \ | |
GIT_AUTHOR_EMAIL=`git log -1 --pretty=format:%%aE $i` \ | |
GIT_AUTHOR_DATE=`git log -1 --pretty=format:%%aD $i` \ | |
GIT_COMMITTER_NAME=`git log -1 --pretty=format:%%cn $i` \ | |
GIT_COMMITTER_EMAIL=`git log -1 --pretty=format:%%cE $i` \ | |
GIT_COMMITTER_DATE=`git log -1 --pretty=format:%%cD $i` \ | |
git commit-tree $i: -p $commit) | |
done | |
git update-ref -m "bup reset" %(refname) $commit %(objectname) | |
echo " ok" | |
' | bash | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment