Created
January 25, 2018 13:47
-
-
Save timplunkett/5d0e8947864952c3d5aa075cca6939e3 to your computer and use it in GitHub Desktop.
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 | |
if [ $# -eq 0 ]; then | |
echo "Usage: git idiff [comment-number] [interdiff-rev] [base-rev]" | |
exit 1 | |
fi | |
COMMIT=${2:-"HEAD^"} | |
BASE_BRANCH=${3:-"8.6.x"} | |
REMOTE=${4:-"origin"} | |
BRANCH=$(git branch-name) | |
BRANCH=${BRANCH//*\//} | |
git diff $REMOTE/$BASE_BRANCH... > ~/Desktop/$BRANCH-$1.patch | |
git log --oneline --reverse --no-decorate $COMMIT... && echo | |
echo $BRANCH-$1-interdiff.txt | |
git diff $COMMIT > ~/Desktop/$BRANCH-$1-interdiff.txt | |
echo $BRANCH-$1.patch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment