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 <fionn@github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
1 parent
34fad27b55
commit
a8d5be9284
6 files changed
+40
-1
No files matched your search
@@ -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
|
||||
|
||||
Vendored
+3
-1
@@ -3,7 +3,7 @@ vim9script
|
||||
# Vim functions for file type detection
|
||||
#
|
||||
# Maintainer: The Vim Project <https://github.com/vim/vim>
|
||||
# Last Change: 2026 Jul 21
|
||||
# Last Change: 2026 Jul 22
|
||||
# Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
|
||||
# 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",
|
||||
|
||||
@@ -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<"
|
||||
@@ -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"
|
||||
@@ -337,6 +337,7 @@ def s:GetFilenameChecks(): dict<list<string>>
|
||||
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'],
|
||||
|
||||
@@ -758,6 +758,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
836,
|
||||
/**/
|
||||
835,
|
||||
/**/
|
||||
|
||||
Reference in new issue
Block a user