pick-to-branch: allow 'h' or 'HEAD' as first argument, which leads to using the maste...
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Fri, 26 Nov 2021 13:47:06 +0000 (14:47 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 3 Dec 2021 11:44:27 +0000 (12:44 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/tools/pull/101)

review-tools/pick-to-branch

index ef8dc7a10bee3bc861a7ccc3af00da0115147220..a1e05b1f012c32c95f06e0c8cc9e2533a617db41 100755 (executable)
@@ -1,14 +1,14 @@
 #! /bin/bash
 
 function usage {
-    echo "Usage: pick-to-branch [<id>] <target> [<num>]
+    echo "Usage: pick-to-branch [<id> | h | HEAD ] <target> [<num>]
 
     Cherry-pick a commit (or <num> commits) on the given target release branch.
     If this is not the current branch, the current branch and its state are preserved.
 
     The optional <id> arg specifies the ID of the (last) commit to cherry-pick.
-    It can be given in the form of a branch name.
-    If no <id> arg is given, the commit id of the HEAD of the master is used.
+    It can also be given in the form of a branch name.  If 'h' or 'HEAD'
+    or no <id> arg is given, the commit id of the HEAD of the master is used.
 
     The <target> 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.
@@ -39,6 +39,10 @@ case $# in
     ;;
 esac
 
+case $id in
+    h|HEAD) id=`git show -s --format="%H" master`;;
+esac
+
 
 case $b in
 *1*0*2*)