hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject hbase git commit: HBASE-15725 make_patch.sh should add the branch name when -b is passed.
Date Fri, 13 May 2016 21:28:23 GMT
Repository: hbase
Updated Branches:
  refs/heads/master b353e388b -> 0e281e192


HBASE-15725 make_patch.sh should add the branch name when -b is passed.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0e281e19
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0e281e19
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0e281e19

Branch: refs/heads/master
Commit: 0e281e1929fbd8332001ef5a2a44091d790a67bb
Parents: b353e38
Author: Elliott Clark <eclark@apache.org>
Authored: Thu May 12 11:15:57 2016 -0700
Committer: Elliott Clark <eclark@apache.org>
Committed: Fri May 13 14:02:00 2016 -0700

----------------------------------------------------------------------
 dev-support/make_patch.sh | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/0e281e19/dev-support/make_patch.sh
----------------------------------------------------------------------
diff --git a/dev-support/make_patch.sh b/dev-support/make_patch.sh
index 446c0a5..0aedf88 100755
--- a/dev-support/make_patch.sh
+++ b/dev-support/make_patch.sh
@@ -24,7 +24,7 @@ while getopts "ahd:b:" opt; do
     case "$opt" in
         a)  addendum='-addendum'
             ;;
-        d)  
+        d)
             patch_dir=$OPTARG
             ;;
         b)
@@ -52,7 +52,7 @@ fi
 # Exit if git status is dirty
 git_dirty=$(git diff --shortstat 2> /dev/null | wc -l|awk {'print $1'})
 echo "git_dirty is $git_dirty"
-if [ "$git_dirty" -ne 0 ]; then  
+if [ "$git_dirty" -ne 0 ]; then
     echo "Git status is dirty. Commit locally first.">&2
     exit 1
 fi
@@ -117,8 +117,15 @@ elif  [ "$status" -ge 1 ]; then
         fi
     done
 fi
+# If this is against a tracking branch other than master
+# include it in the patch name
+tracking_suffix=""
+if [[ $tracking_branch != "origin/master" \
+    &&  $tracking_branch != "master" ]]; then
+    tracking_suffix="-${tracking_branch#origin/}"
+fi
 
-patch_name="$branch$prefix$addendum.patch"
+patch_name="$branch$prefix$addendum$tracking_suffix.patch"
 
 # Do we need to make a diff?
 git diff --quiet $tracking_branch
@@ -134,10 +141,10 @@ local_commits=$(git log $tracking_branch..$branch|grep 'Author:'|wc
-l|awk {'pri
 if [ "$local_commits" -gt 1 ]; then
     read -p "$local_commits commits exist only in your local branch. Interactive rebase?"
yn
     case $yn in
-        [Yy]* ) 
+        [Yy]* )
             git rebase -i $tracking_branch
                 ;;
-        [Nn]* ) 
+        [Nn]* )
           echo "Creating $patch_dir/$patch_name using git diff."
           git diff $tracking_branch > $patch_dir/$patch_name
           exit 0
@@ -147,5 +154,3 @@ fi
 
 echo "Creating patch $patch_dir/$patch_name using git format-patch"
 git format-patch --stdout $tracking_branch > $patch_dir/$patch_name
-
-


Mime
View raw message