From b88480f1e21c32b964758437bf20361c269ac6ac Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Tue, 15 Nov 2011 16:11:49 -0500 Subject: [PATCH] In git-patch: Allowing for branch names that include slashes and passing in the target branch instead of always using master --- git-patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/git-patch b/git-patch index d6cbfa8..ca01896 100755 --- a/git-patch +++ b/git-patch @@ -5,7 +5,9 @@ CURRENT_DIR=$(basename $(pwd)) PATCH_DIR="${HOME}/Documents/Patches/${CURRENT_DIR}" -mkdir -p ${PATCH_DIR} +TARGET_BRANCH="${1-master}" +DEST="${PATCH_DIR}/${CURRENT_BRANCH}-${TARGET_BRANCH}.diff" +mkdir -p "$(dirname $DEST)" -git format-patch master --stdout > ${PATCH_DIR}/${CURRENT_BRANCH}.diff +git format-patch ${TARGET_BRANCH} --stdout > $DEST