mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
chore(vim-patch.sh): replace hub with gh (#15162)
This commit is contained in:
@@ -326,12 +326,14 @@ 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.
|
||||
|
||||
See the wiki for more information:
|
||||
* https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-vim
|
||||
' "${vim_version}" "${BASENAME}" "${BASENAME}"
|
||||
return $ret
|
||||
return $ret
|
||||
}
|
||||
|
||||
gh_pr() {
|
||||
gh pr create --title "$1" --body "$2"
|
||||
}
|
||||
@@ -341,14 +343,14 @@ submit_pr() {
|
||||
pr_message="$(printf '%s\n\n%s\n' "$1" "$2")"
|
||||
git hub pull new -m "${pr_message}"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2015
|
||||
|
||||
# shellcheck disable=SC2015
|
||||
# ^ "Note that A && B || C is not if-then-else."
|
||||
submit_pr() {
|
||||
require_executable git
|
||||
local push_first
|
||||
push_first=1
|
||||
local submit_fn
|
||||
push_first=1
|
||||
local submit_fn
|
||||
if check_executable gh; then
|
||||
submit_fn="gh_pr"
|
||||
elif check_executable git-hub; then
|
||||
@@ -371,9 +373,7 @@ submit_pr() {
|
||||
local git_remote
|
||||
git_remote="$(find_git_remote)"
|
||||
local pr_body
|
||||
pr_body="$(git log --grep=vim-patch --reverse --format='#### %s%n%n%b%n' "${git_remote}"/master..HEAD)"
|
||||
local patches
|
||||
# Extract just the "vim-patch:X.Y.ZZZZ" or "vim-patch:sha" portion of each log
|
||||
pr_body="$(git log --grep=vim-patch --reverse --format='#### %s%n%n%b%n' "${git_remote}"/master..HEAD)"
|
||||
local patches
|
||||
# Extract just the "vim-patch:X.Y.ZZZZ" or "vim-patch:sha" portion of each log
|
||||
patches=("$(git log --grep=vim-patch --reverse --format='%s' "${git_remote}"/master..HEAD | sed 's/: .*//')")
|
||||
@@ -385,7 +385,7 @@ submit_pr() {
|
||||
|
||||
if [[ $push_first -ne 0 ]]; then
|
||||
echo "Pushing to 'origin/${checked_out_branch}'."
|
||||
output="$(git push origin "${checked_out_branch}" 2>&1)" &&
|
||||
output="$(git push origin "${checked_out_branch}" 2>&1)" &&
|
||||
msg_ok "${output}" ||
|
||||
(msg_err "${output}"; false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user