From: Fionn Fitzmaurice Date: Wed, 22 Jul 2026 19:49:58 +0000 (+0000) Subject: patch 9.2.0836: filetype: .git-blame-ignore-revs file is not recognized X-Git-Tag: v9.2.0836^0 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a8d5be92845df7fc0e9e4399545bd5c01bba536a;p=thirdparty%2Fvim.git patch 9.2.0836: filetype: .git-blame-ignore-revs file is not recognized Problem: filetype: .git-blame-ignore-revs file is not recognized Solution: Detect .git-blame-ignore-revs file as gitrevlist filetype, include syntax and filetype plugins (Fionn Fitzmaurice) A Git revision list is > a list of object names (i.e. one unabbreviated SHA-1 per line)..., > comments (#), empty lines, and any leading and trailing whitespace are > ignored. (from Git's fsck.skipList documentation). The default output of git rev-list will match this. It is also suitable as input to git blame --ignore-revs-file. This adds filetype detection matching .git-blame-ignore-revs files, syntax highlighting and basic filetype settings. closes: #20702 Signed-off-by: Fionn Fitzmaurice Signed-off-by: Christian Brabandt --- diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index 880414e299..ea76824880 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -206,6 +206,7 @@ runtime/ftplugin/gitcommit.vim @tpope runtime/ftplugin/gitconfig.vim @tpope runtime/ftplugin/gitignore.vim @ObserverOfTime runtime/ftplugin/gitrebase.vim @tpope +runtime/ftplugin/gitrevlist.vim @fionn runtime/ftplugin/gitsendemail.vim @tpope runtime/ftplugin/gleam.vim @kirillmorozov runtime/ftplugin/go.vim @dbarnett diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 7473896b06..25414c490c 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2026 Jul 21 +# Last Change: 2026 Jul 22 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -3271,6 +3271,8 @@ const ft_from_name = { "TAG_EDITMSG": "gitcommit", "NOTES_EDITMSG": "gitcommit", "EDIT_DESCRIPTION": "gitcommit", + # Git revision list + ".git-blame-ignore-revs": "gitrevlist", # gnash(1) configuration files "gnashrc": "gnash", ".gnashrc": "gnash", diff --git a/runtime/ftplugin/gitrevlist.vim b/runtime/ftplugin/gitrevlist.vim new file mode 100644 index 0000000000..6282203556 --- /dev/null +++ b/runtime/ftplugin/gitrevlist.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: Git revision list +" Author: Fionn Fitzmaurice (github.com/fionn) +" Maintainer: Fionn Fitzmaurice (github.com/fionn) +" License: Vim & Apache 2.0 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:# +setlocal commentstring=#\ %s +setlocal keywordprg=git\ show + +let b:undo_ftplugin = "setl comments< commentstring< keywordprg<" diff --git a/runtime/syntax/gitrevlist.vim b/runtime/syntax/gitrevlist.vim new file mode 100644 index 0000000000..11b4b0a9cc --- /dev/null +++ b/runtime/syntax/gitrevlist.vim @@ -0,0 +1,17 @@ +" Vim syntax file +" Language: Git revision list +" Author: Fionn Fitzmaurice (github.com/fionn) +" Maintainer: Fionn Fitzmaurice (github.com/fionn) +" License: Vim & Apache 2.0 + +if exists("b:current_syntax") + finish +endif + +syn match gitrevlistHash "\<\x\{40}\>\|\<\x\{64}\>" contains=@NoSpell nextgroup=gitrevlistComment skipwhite +syn match gitrevlistComment "#.*$" + +hi def link gitrevlistHash Identifier +hi def link gitrevlistComment Comment + +let b:current_syntax = "gitrevlist" diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index 79ce8ff9c4..4c03d5f508 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -337,6 +337,7 @@ def s:GetFilenameChecks(): dict> gitignore: ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'] + WhenConfigHome('$XDG_CONFIG_HOME/git/ignore') + ['.prettierignore', '.fdignore', '/.config/fd/ignore', '.ignore', '.rgignore', '.dockerignore', '.containerignore', '.npmignore', '.vscodeignore'], gitolite: ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'], gitrebase: ['git-rebase-todo'], + gitrevlist: ['.git-blame-ignore-revs'], gitsendemail: ['.gitsendemail.msg.xxxxxx'], gkrellmrc: ['gkrellmrc', 'gkrellmrc_x'], gleam: ['file.gleam'], diff --git a/src/version.c b/src/version.c index ac615f9b9a..d814250994 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 836, /**/ 835, /**/