vim-patch.sh: List in chronological order. #4034

This commit is contained in:
Florian Walch 2016-01-19 11:32:14 +01:00 committed by Justin M. Keyes
parent a2ec5a569b
commit 03d8adda8e

View File

@ -161,29 +161,19 @@ list_vim_patches() {
printf "\nVim patches missing from Neovim:\n"
# Get tags since 7.4.442.
local vim_tags=$(cd "${VIM_SOURCE_DIR}" && git tag --contains v7.4.442)
# Get non-versioned commits since e2719096.
if git log -1 --grep='.' --invert-grep > /dev/null 2>&1 ; then
local vim_runtime_commits=$(cd "${VIM_SOURCE_DIR}" && \
git log --reverse --format='%H' --grep='^patch' --grep='^updated for version' \
--invert-grep e2719096250a19ecdd9a35d13702879f163d2a50..HEAD)
else # --invert-grep requires git 2.4+
echo "Warning: some runtime updates may not be listed (requires git 2.4+)."
local vim_runtime_commits=$(cd "${VIM_SOURCE_DIR}" && \
git log --reverse --format='%H' --grep='Updated' e2719096250a19ecdd9a35d13702879f163d2a50..HEAD)
fi
# Get commits since 7.4.602.
local vim_commits=$(cd "${VIM_SOURCE_DIR}" && git log --reverse --format='%H' v7.4.602..HEAD)
local vim_commit
for vim_commit in ${vim_tags} ${vim_runtime_commits}; do
for vim_commit in ${vim_commits}; do
local is_missing
if [[ ${vim_commit} =~ v([0-9].[0-9].([0-9]{3,4})) ]]; then
local patch_number="${BASH_REMATCH[2]}"
local vim_tag=$(cd "${VIM_SOURCE_DIR}" && git describe --tags --exact-match "${vim_commit}" 2>/dev/null)
if [[ -n "${vim_tag}" ]]; then
local patch_number="${vim_tag:5}" # Remove prefix like "v7.4."
# Tagged Vim patch, check version.c:
is_missing="$(sed -n '/static int included_patches/,/}/p' "${NEOVIM_SOURCE_DIR}/src/nvim/version.c" |
grep -x -e "[[:space:]]*//[[:space:]]${patch_number} NA" -e "[[:space:]]*${patch_number}," >/dev/null && echo "false" || echo "true")"
vim_commit="${BASH_REMATCH[1]//-/.}"
vim_commit="${vim_tag#v}"
else
# Untagged Vim patch (e.g. runtime updates), check the Neovim git log:
is_missing="$(cd "${NEOVIM_SOURCE_DIR}" &&
@ -203,6 +193,9 @@ list_vim_patches() {
echo
echo " Examples: '${BASENAME} -p 7.4.487'"
echo " '${BASENAME} -p 1e8ebf870720e7b671f98f22d653009826304c4f'"
echo
echo " NOTE: Please port the _oldest_ patch if you possibly can."
echo " Out-of-order patches increase the possibility of bugs."
}
review_pr() {