aboutsummaryrefslogtreecommitdiff
path: root/scripts/vim-patch.sh
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2018-07-10 20:12:14 -0400
committerGitHub <noreply@github.com>2018-07-10 20:12:14 -0400
commitec6e78e77ca3b3a2b8bbe8b472cf8c5d6545c82d (patch)
tree81c3788bfa9be5cbe2265fa7685f714cf99341d1 /scripts/vim-patch.sh
parenta315026dc290dc3841ee4485660bcb71d59e4ce8 (diff)
parent35b269f51fcb17505384a9e38d4ab30931339dcc (diff)
downloadrneovim-ec6e78e77ca3b3a2b8bbe8b472cf8c5d6545c82d.tar.gz
rneovim-ec6e78e77ca3b3a2b8bbe8b472cf8c5d6545c82d.tar.bz2
rneovim-ec6e78e77ca3b3a2b8bbe8b472cf8c5d6545c82d.zip
Merge pull request #8716 from mhinz/vim-patch/wrapped-lines
[RFC] vim-patch.sh: handle wrapped commit messages
Diffstat (limited to 'scripts/vim-patch.sh')
-rwxr-xr-xscripts/vim-patch.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 4912b2160b..22f946ebd9 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -449,12 +449,21 @@ review_commit() {
assign_commit_details "${vim_version}"
+ echo
+ echo "Creating files."
+ echo "${nvim_patch}" > "${NVIM_SOURCE_DIR}/n${patch_file}"
+ msg_ok "Saved pull request diff to '${NVIM_SOURCE_DIR}/n${patch_file}'."
+ CREATED_FILES+=("${NVIM_SOURCE_DIR}/n${patch_file}")
+
+ local nvim="nvim -u NORC -n -i NONE --headless"
+ 2>/dev/null $nvim --cmd 'set dir=/tmp' +'1,/^$/g/^ /-1join' +w +q "${NVIM_SOURCE_DIR}/n${patch_file}"
+
local expected_commit_message
expected_commit_message="$(commit_message)"
local message_length
message_length="$(wc -l <<< "${expected_commit_message}")"
local commit_message
- commit_message="$(tail -n +4 <<< "${nvim_patch}" | head -n "${message_length}")"
+ commit_message="$(tail -n +4 "${NVIM_SOURCE_DIR}/n${patch_file}" | head -n "${message_length}")"
if [[ "${commit_message#${git_patch_prefix}}" == "${expected_commit_message}" ]]; then
msg_ok "Found expected commit message."
else
@@ -465,12 +474,6 @@ review_commit() {
echo "${commit_message#${git_patch_prefix}}"
fi
- echo
- echo "Creating files."
- echo "${nvim_patch}" > "${NVIM_SOURCE_DIR}/n${patch_file}"
- msg_ok "Saved pull request diff to '${NVIM_SOURCE_DIR}/n${patch_file}'."
- CREATED_FILES+=("${NVIM_SOURCE_DIR}/n${patch_file}")
-
get_vimpatch "${vim_version}"
CREATED_FILES+=("${NVIM_SOURCE_DIR}/${patch_file}")