changeset 30196:381462ee23fd v9.0.0434

patch 9.0.0434: gitignore files are not recognized Commit: https://github.com/vim/vim/commit/9ba2786f15f0b53a90fd221832a5bedfc6dbfe20 Author: ObserverOfTime <chronobserver@disroot.org> Date: Sat Sep 10 11:04:24 2022 +0100 patch 9.0.0434: gitignore files are not recognized Problem: gitignore files are not recognized. Solution: Add patterns for the gitignore filetype. (closes https://github.com/vim/vim/issues/11102)
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Sep 2022 12:15:04 +0200
parents a7a66422cded
children df7cabff92a8
files runtime/filetype.vim src/testdir/test_filetype.vim src/version.c
diffstat 3 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -721,12 +721,15 @@ au BufNewFile,BufRead .gitmodules,*.git/
 if !empty($XDG_CONFIG_HOME)
   au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config		setf gitconfig
   au BufNewFile,BufRead $XDG_CONFIG_HOME/git/attributes		setf gitattributes
+  au BufNewFile,BufRead $XDG_CONFIG_HOME/git/ignore		setf gitignore
 endif
 au BufNewFile,BufRead .gitattributes,*.git/info/attributes	setf gitattributes
-au BufNewFile,BufRead */.config/git/attributes  		setf gitattributes
-au BufNewFile,BufRead */etc/gitattributes  			setf gitattributes
-au BufNewFile,BufRead git-rebase-todo		setf gitrebase
-au BufRead,BufNewFile .gitsendemail.msg.??????	setf gitsendemail
+au BufNewFile,BufRead */.config/git/attributes			setf gitattributes
+au BufNewFile,BufRead */etc/gitattributes			setf gitattributes
+au BufNewFile,BufRead .gitignore,*.git/info/exclude		setf gitignore
+au BufNewFile,BufRead */.config/git/ignore			setf gitignore
+au BufNewFile,BufRead git-rebase-todo				setf gitrebase
+au BufRead,BufNewFile .gitsendemail.msg.??????			setf gitsendemail
 au BufNewFile,BufRead *.git/*
       \ if getline(1) =~# '^\x\{40,\}\>\|^ref: ' |
       \   setf git |
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -216,6 +216,7 @@ let s:filename_checks = {
     \ 'gitattributes': ['file.git/info/attributes', '.gitattributes', '/.config/git/attributes', '/etc/gitattributes', '/usr/local/etc/gitattributes', 'some.git/info/attributes'],
     \ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG', 'NOTES_EDITMSG', 'EDIT_DESCRIPTION'],
     \ 'gitconfig': ['file.git/config', 'file.git/config.worktree', 'file.git/worktrees/x/config.worktree', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/usr/local/etc/gitconfig', '/etc/gitconfig.d/file', 'any/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'],
+    \ 'gitignore': ['file.git/info/exclude', '.gitignore', '/.config/git/ignore', 'some.git/info/exclude'],
     \ 'gitolite': ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'],
     \ 'gitrebase': ['git-rebase-todo'],
     \ 'gitsendemail': ['.gitsendemail.msg.xxxxxx'],
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    434,
+/**/
     433,
 /**/
     432,