-
-
Save jonespm/21235befabd715bce135 to your computer and use it in GitHub Desktop.
Merge from github
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
gitmerge() { | |
#Commands this needs | |
CURL=`which -p curl` | |
GREP=`which -p grep` | |
AWK=`which -p awk` | |
TR=`which -p tr` | |
UNIQ=`which -p uniq` | |
tmpfile=$(tempfile) | |
if [ "$1" ]; then | |
command $CURL -s https://github.com/sakaiproject/sakai/pull/$1.patch > $tmpfile | |
patch -p1 < $tmpfile | |
if [ "$?" = "0" ]; then | |
tool=`$GREP "+++" $tmpfile | $AWK -F/ {'print \$2'}` | $UNIQ | $TR '\n' ',' | |
echo "Patch succeeded to $tool, you can commit!" | |
else | |
echo "There was some failure patching, please check the output above" | |
fi | |
rm $tmpfile | |
else | |
echo "You need to specify as a parameter which pull request to merge. For example, gitmerge 122. This should be run at the top level directory." | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment