Created
November 9, 2010 13:21
-
-
Save wereHamster/669059 to your computer and use it in GitHub Desktop.
Cherry-pick a svn commit and add a 'Merged from rX' message at the bottom
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/sh | |
# $1 commit to cherry-pick | |
# $2 branch to apply it to (optional) | |
# | |
# Example usage: | |
# git svn-cherry-pick HEAD release-5.4 | |
# rake test:all && git svn dcommit | |
commit="$(git rev-parse "$1")" | |
test -n "$2" && git checkout "$2" | |
git format-patch --stdout "$commit^!" | \ | |
sed -e 's/^git-svn-id.*@\([0-9]*\) .*$/Merged from r\1/' | \ | |
git am -3 -q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment