From fb1f321b0efb31101891ec6cc93d4087bc4ee325 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 3 Oct 2026 23:28:46 -0400 Subject: build(vim-patch.sh): -L,-l works for 1 file (#42227) https://github.com/neovim/neovim/pull/42121 broke "-L" and "-l" for commits specific to 1 file because majority of Vim commits are tagged and "git log --tags --no-walk" is inconsistent for 1-file queries. "git log --stdin --no-walk" does work so it's always required regardless of additional formatting. ---- Tags v9.0.0055 and v9.0.0056 are on the same commit. Detecting 1 of the tags resolves the other for "-L" and "-l". Patch 9.0.0056 is N/A based on commit e15f79c659f8895afdb946333757ad5517329805 . vim-patch.sh can't auto-detect v9.0.0056 yet. ---- TODO Prevent developer from overwriting essential "--format=" flags else vim-patch.sh produces invalid Git refs. --- scripts/vim-patch.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'scripts/vim-patch.sh') diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 7293a58fea..1580ef72aa 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -626,10 +626,13 @@ list_missing_vimpatches() { VIM_VERSION_0_DATE=2018-05-17:15:00:00Z local extended_format=$1; shift + + # XXX(@janlazo): Delimiter "%x00" required to detect tagged commits + # https://git-scm.com/docs/git-log#Documentation/git-log.txt-x00 if [[ "$extended_format" == 1 ]]; then - git_log_format="%s" + git_log_format="%H%x00%d%x00: %s" else - git_log_format="" + git_log_format="%H%x00%(decorate:prefix=,suffix=,tag=)" fi # Massage arguments for git-log. @@ -649,20 +652,15 @@ list_missing_vimpatches() { git_log_args+=("$i") done - missing_numbers=$(_git -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --since="${VIM_VERSION_0_DATE}" --no-walk --tags --format='%(decorate:prefix=,suffix=,tag=)' "${git_log_args[@]}" | + missing_numbers=$(_git -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --since="${VIM_VERSION_0_DATE}" --no-walk --tags --format='%(decorate:prefix=,suffix=,tag=)' | grep -v -F -f <(list_vimpatch_numbers) | - sed -E 's/,.*$//') - missing_hashes=$(_git -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --since="${VIM_VERSION_0_DATE}" --format='%H%D' "${git_log_args[@]}" | + grep -oE 'v[0-9]+\.[0-9]+\.[0-9]{4}') + missing_hashes=$(_git -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --since="${VIM_VERSION_0_DATE}" --format='%H%D' | grep -v -e 'tag:' | grep -v -f <(list_vimpatch_hashes | sed -E 's/(.*)/^\1/')) - if test -n "${git_log_format}"; then - (echo "${missing_numbers}"; echo "${missing_hashes}") | - _git --no-pager -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --no-walk --stdin --format="%H%x00%d%x00: ${git_log_format}" | - awk -F '\0' '{ print $2 ? $2$3 : $1$3 }' - else - echo "${missing_numbers}" - echo "${missing_hashes}" - fi + (echo "${missing_numbers}"; echo "${missing_hashes}") | + _git --no-pager -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --no-walk --stdin --format="${git_log_format}" "${git_log_args[@]}" | + awk -F '\0' '{ print $2 ? $2$3 : $1$3 }' } # Prints a human-formatted list of Vim commits, with instructional messages. -- cgit