aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-05 10:11:31 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-03-05 10:12:17 +0800
commit0ec92bb4634ef19798eef065fdef3d6afb43ccc5 (patch)
treecbaf11479a5108c3ffc0789c4a22846b415f6caa
parent83fc914337100d03f2e41a3943ccf0107d893698 (diff)
downloadrneovim-0ec92bb4634ef19798eef065fdef3d6afb43ccc5.tar.gz
rneovim-0ec92bb4634ef19798eef065fdef3d6afb43ccc5.tar.bz2
rneovim-0ec92bb4634ef19798eef065fdef3d6afb43ccc5.zip
feat(vim-patch.sh): support additional args for -s
This allows creating a draft vim-patch PR.
-rwxr-xr-xscripts/vim-patch.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 67a2cc96fd..591c658e6b 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -36,7 +36,7 @@ usage() {
echo " can be a Vim version (8.0.xxx) or a Git hash."
echo " -P {vim-revision} Download, generate and apply a Vim patch."
echo " -g {vim-revision} Download a Vim patch."
- echo " -s Create a vim-patch pull request."
+ echo " -s [pr args] Create a vim-patch pull request."
echo " -r {pr-number} Review a vim-patch pull request."
echo " -V Clone the Vim source code to \$VIM_SOURCE_DIR."
echo
@@ -329,7 +329,8 @@ stage_patch() {
* Do this only for _related_ patches (otherwise it increases the
size of the pull request, making it harder to review)
- When you are done, try "%s -s" to create the pull request.
+ When you are done, try "%s -s" to create the pull request,
+ or "%s -s --draft" to create a draft pull request.
See the wiki for more information:
* https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-vim
@@ -338,13 +339,19 @@ stage_patch() {
}
gh_pr() {
- gh pr create --title "$1" --body "$2"
+ local pr_title
+ local pr_body
+ pr_title="$1"
+ pr_body="$2"
+ shift 2
+ gh pr create --title "${pr_title}" --body "${pr_body}" "$@"
}
git_hub_pr() {
local pr_message
pr_message="$(printf '%s\n\n%s\n' "$1" "$2")"
- git hub pull new -m "${pr_message}"
+ shift 2
+ git hub pull new -m "${pr_message}" "$@"
}
submit_pr() {
@@ -408,7 +415,7 @@ submit_pr() {
fi
echo "Creating pull request."
- if output="$($submit_fn "$pr_title" "$pr_body" 2>&1)"; then
+ if output="$($submit_fn "$pr_title" "$pr_body" "$@" 2>&1)"; then
msg_ok "$output"
else
msg_err "$output"
@@ -799,7 +806,8 @@ while getopts "hlLmMVp:P:g:r:s" opt; do
exit 0
;;
s)
- submit_pr
+ shift # remove opt
+ submit_pr "$@"
exit 0
;;
V)