You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If g:gitwildignore_use_ls_files is set to 1, then wildignore will contain the full path to every ignored file. For small repositories (maybe a dozen or so ignored files) this isn't much of a problem, but for larger repos it will almost certainly become a problem, especially when ignoring things like .pyc files.
Solution
As an optimization, vim-gitwildignore might do the following:
Read in all .gitignore files
Use git ls-files... to find all the ignored files and directories.
If there are no negations in the .gitignore files, then:
Add each ignored directory to wildignore (corresponding to the implementation in 4c9144f)
For each ignored file (ls-files output), find the ignore pattern that matches it and add it to a list.
Might need to do something clever to find the closest/last match (i.e. later in the files)
Make sure that list only contains one of each element (or just treat the list as a set to begin with), and add that list, joined with commas, to wildignore.
If there are negations in the list, then:
If some option (e.g. g:gitwildignore_skip_negations) says to ignore negations, goto 3.i.
Else, TBD
(3.ii and 3.iii can more or less be boiled down to "add every file ignore from .gitignore files to wildignore, especially since that means that even ignores which aren't used right now (like *.o when you haven't run make) are in place.)
The gist of this idea is so that if you're using an ignore like *.pyc, and nothing negates that ignore, then just plug *.pyc (or [git root]/**/*.pyc?) into wildignore, rather than adding each and every .pyc file. This will cut down on the length of the wildignore value.
The text was updated successfully, but these errors were encountered:
Problem statement
If
g:gitwildignore_use_ls_files
is set to 1, thenwildignore
will contain the full path to every ignored file. For small repositories (maybe a dozen or so ignored files) this isn't much of a problem, but for larger repos it will almost certainly become a problem, especially when ignoring things like.pyc
files.Solution
As an optimization, vim-gitwildignore might do the following:
.gitignore
filesgit ls-files
... to find all the ignored files and directories..gitignore
files, then:wildignore
(corresponding to the implementation in 4c9144f)wildignore
.g:gitwildignore_skip_negations
) says to ignore negations, goto 3.i.(3.ii and 3.iii can more or less be boiled down to "add every file ignore from
.gitignore
files towildignore
, especially since that means that even ignores which aren't used right now (like*.o
when you haven't runmake
) are in place.)The gist of this idea is so that if you're using an ignore like
*.pyc
, and nothing negates that ignore, then just plug*.pyc
(or[git root]/**/*.pyc
?) intowildignore
, rather than adding each and every .pyc file. This will cut down on the length of thewildignore
value.The text was updated successfully, but these errors were encountered: