Created
May 5, 2017 00:45
-
-
Save mpdonadio/110bed0a5ce77e6bbed8d52c81a2a4cc to your computer and use it in GitHub Desktop.
Generate a Drupal patch+interdiff when using branch-per-patch method, where branch is issue#-comment#. Doesn't take into account fetching or rebasing.
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 | |
ISSUE=`git rev-parse --abbrev-ref HEAD | cut -d'-' -f1` | |
COMMENT1=`git branch | grep -B 1 '*' | head -1 | cut -d'-' -f2` | |
COMMENT2=`git rev-parse --abbrev-ref HEAD | cut -d'-' -f2` | |
rm -f *.patch interdiff*.txt | |
git diff origin/8.4.x > `git rev-parse --abbrev-ref HEAD`.patch | |
if [ "${COMMENT1}" != "${COMMENT2}" ]; then | |
git diff ${ISSUE}-${COMMENT1} > interdiff-${COMMENT1}-${COMMENT2}.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment