]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-backport.sh: rename --prepare to --cherry-pick-only 30879/head
authorNathan Cutler <ncutler@suse.com>
Thu, 24 Oct 2019 11:26:50 +0000 (13:26 +0200)
committerNathan Cutler <ncutler@suse.com>
Thu, 24 Oct 2019 11:51:36 +0000 (13:51 +0200)
And really stop after cherry-pick phase.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/script/ceph-backport.sh

index 09585744cc5f604b8179121b4c47dab5d8e4d758..aab85741b902baf6b036d37d2efb83d9358ef0b0 100755 (executable)
@@ -616,6 +616,7 @@ Usage:
    ${this_script} BACKPORT_TRACKER_ISSUE_NUMBER
 
 Options (not needed in normal operation):
+    --cherry-pick-only (stop after cherry-pick phase)
     -c/--component COMPONENT
                        (explicitly set the component label; if omitted, the
                         script will try to guess the component)
@@ -665,6 +666,9 @@ PR phase:
 7. (optionally) setting the milestone and label in the PR
 8. updating the Backport tracker issue
 
+When run with --cherry-pick-only, the script will stop after the cherry-pick
+phase.
+
 If any of the commits do not cherry-pick cleanly, the script will abort in
 step 4. In this case, you can either finish the cherry-picking manually
 or abort the cherry-pick. In any case, when and if the local wip branch is
@@ -813,14 +817,14 @@ fi
 # process command-line arguments
 #
 
-munged_options=$(getopt -o c:dhpsv --long "component:,debug,help,milestones,prepare,setup,setup-advice,troubleshooting-advice,update-version,usage-advice,verbose,version" -n "$this_script" -- "$@")
+munged_options=$(getopt -o c:dhsv --long "cherry-pick-only,component:,debug,help,milestones,setup,setup-advice,troubleshooting-advice,update-version,usage-advice,verbose,version" -n "$this_script" -- "$@")
 eval set -- "$munged_options"
 
 ADVICE=""
 CHECK_MILESTONES=""
+CHERRY_PICK_ONLY=""
 DEBUG=""
 EXPLICIT_COMPONENT=""
-EXPLICIT_PREPARE=""
 HELP=""
 ISSUE=""
 SETUP_ADVICE=""
@@ -830,11 +834,11 @@ USAGE_ADVICE=""
 VERBOSE=""
 while true ; do
     case "$1" in
+        --cherry-pick-only) CHERRY_PICK_ONLY="$1" ; shift ;;
         --component|-c) shift ; EXPLICIT_COMPONENT="$1" ; shift ;;
         --debug|-d) DEBUG="$1" ; shift ;;
         --help|-h) ADVICE="1" ; HELP="$1" ; shift ;;
         --milestones) CHECK_MILESTONES="$1" ; shift ;;
-        --prepare|-p) EXPLICIT_PREPARE="$1" ; shift ;;
         --setup|-s) SETUP_ONLY="$1" ; shift ;;
         --setup-advice) ADVICE="1" ; SETUP_ADVICE="$1" ; shift ;;
         --troubleshooting-advice) ADVICE="$1" ; TROUBLESHOOTING_ADVICE="$1" ; shift ;;
@@ -995,7 +999,7 @@ debug "Milestone number is $milestone_number"
 
 local_branch=wip-${issue}-${target_branch}
 if git show-ref --verify --quiet refs/heads/$local_branch ; then
-    if [ "$EXPLICIT_PREPARE" ] ; then
+    if [ "$CHERRY_PICK_ONLY" ] ; then
         error "local branch $local_branch already exists -- cannot -prepare"
         false
     fi
@@ -1003,6 +1007,7 @@ if git show-ref --verify --quiet refs/heads/$local_branch ; then
 else
     info "$local_branch does not exist: will create it and attempt automated cherry-pick"
     cherry_pick_phase
+    [ "$CHERRY_PICK_ONLY" ] && exit 0
 fi