You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2021/09/23 08:52:40 UTC

svn commit: r1893541 - /httpd/dev-tools/github/create_pr.sh

Author: rpluem
Date: Thu Sep 23 08:52:40 2021
New Revision: 1893541

URL: http://svn.apache.org/viewvc?rev=1893541&view=rev
Log:
* Use gh over hub when available for creating the PR

Modified:
    httpd/dev-tools/github/create_pr.sh

Modified: httpd/dev-tools/github/create_pr.sh
URL: http://svn.apache.org/viewvc/httpd/dev-tools/github/create_pr.sh?rev=1893541&r1=1893540&r2=1893541&view=diff
==============================================================================
--- httpd/dev-tools/github/create_pr.sh (original)
+++ httpd/dev-tools/github/create_pr.sh Thu Sep 23 08:52:40 2021
@@ -9,7 +9,8 @@
 # - upstream: which points to https://github.com/apache/httpd.git
 # Furthermore you need to have remote tracking branches for the trunk and
 # 2.4.x branches in your clone that are tracked in your fork.
-# Requires git and hub be on the PATH.
+# Requires git and hub or gh be on the PATH.
+# If gh is available it will be preferred over hub.
 
 
 if [ "$#" -lt 1 ] ; then
@@ -61,7 +62,11 @@ done
 
 git push -u origin $BRANCH_NAME
 MESSAGE=`echo "$@" | sed -e 's/ /, r/g'`
-RESULT=`hub pull-request -b apache:2.4.x -m "Merge r${MESSAGE} from trunk"`
+if type -P gh > /dev/null ; then
+    RESULT=`gh pr create -B 2.4.x -b "Merge r${MESSAGE} from trunk" --title "Merge r${MESSAGE} from trunk"`
+else
+    RESULT=`hub pull-request -b apache:2.4.x -m "Merge r${MESSAGE} from trunk"`
+fi
 echo $RESULT
 PR=`echo $RESULT | sed -e 's#.*/##'`
 
@@ -77,6 +82,7 @@ done
 cat <<EOF
      Backport version for 2.4.x of patch:
        https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/$PR.diff
+     Can be applied via apply_backport_pr.sh $PR
      +1:
 EOF