[tools] master update

tomas at openssl.org tomas at openssl.org
Fri Nov 26 09:50:16 UTC 2021


The branch master has been updated
       via  dbfd886b5913a62543159c621013b4093434df13 (commit)
      from  be4668a589f159422522dc2619fd1a7bd8dea589 (commit)


- Log -----------------------------------------------------------------
commit dbfd886b5913a62543159c621013b4093434df13
Author: Tomas Mraz <tomas at openssl.org>
Date:   Mon Nov 22 15:25:49 2021 +0100

    pick-to-branch: Allow cherry-picking multiple commits at once
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/tools/pull/100)

-----------------------------------------------------------------------

Summary of changes:
 review-tools/pick-to-branch | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/review-tools/pick-to-branch b/review-tools/pick-to-branch
index ac4176a..3254fca 100755
--- a/review-tools/pick-to-branch
+++ b/review-tools/pick-to-branch
@@ -1,17 +1,27 @@
 #! /bin/bash
 
 function usage {
-    echo "Usage: pick-to-branch [<id>] <branch>
-    Cherry-pick a commit on the given release target branch.
+    echo "Usage: pick-to-branch [<id>] <branch> [<num>]
+    Cherry-pick a commit (or <num> commits) on the given release target branch.
     If this is not the current branch, the current branch and its state are preserved.
 
     The commit can be given in the form of a branch name.
     If no <id> arg is given, use the commit id of the HEAD of the master.
     The <branch> arg must match a release branch or start with 'm' for master.
-    A release branch may be given simply as 102, 110, 111, 30, 31."
+    A release branch may be given simply as 102, 110, 111, 30, 31.
+
+    The <num> argument defaults to 1 and can be specified only in case <id> is
+    also given."
 }
 
+num=1
+
 case $# in
+3)
+    id=$1
+    b=$2
+    num=$3
+    ;;
 2)
     id=$1
     b=$2
@@ -52,11 +62,14 @@ m*)
     ;;
 esac
 
-echo "Commit to chery-pick is $id:"
-git show $id | head -n 5
-echo
+echo "First commit to cherry-pick is: $id~$((num - 1))"
 echo "Target branch is: $branch"
-echo "Are both of these correct?"
+echo "Number of commits to pick: $num"
+echo "Commits to be cherry-picked:"
+echo
+git log $id~$num..$id
+echo
+echo "Are these correct?"
 
 while true
 do
@@ -102,7 +115,7 @@ git checkout --quiet master
 git checkout $branch
 git pull --ff-only
 CHERRYPICKING=1
-git cherry-pick -e -x $id || (git cherry-pick --abort; exit 1)
+git cherry-pick -e -x $id~$num..$id || (git cherry-pick --abort; exit 1)
 CHERRYPICKING=
 
 while true


More information about the openssl-commits mailing list