RichiH/vcsh

Git >= 2.7 changed the meaning of `!`, breaking write-ignore

Closed this issue · 4 comments

Right now, write-ignore produces a file like this:

!/foo
!/foo/bar
!/foo/bar/baz.txt

But, as of 2.7, all files and directories in /foo and /foo/bar will now show up as untracked. It is completely sufficient to specify only the actual file:

!/foo/bar/baz.txt

https://git.kernel.org/cgit/git/git.git/tree/Documentation/RelNotes/2.7.0.txt

  • Allow a later "!/abc/def" to override an earlier "/abc" that
    appears in the same .gitignore file to make it easier to express
    "everything in /abc directory is ignored, except for ...".

Reading the docs, that seems as if this is not actually a problem? Are you using none, exact, or recursive?

The VCSH_GITIGNORE is unset. I've tried none, exact and recursive but I cant't spot a difference. When I run git status I get a list of untracked files. Compared to previous git versions this is a different behaviour. Not really a problem, but kinda annoying.

I ran into the same annoyance and have started manually pulling the extraneous entries out of the ignore files to compensate.

I can't say I am happy with the patch, but it seems to do what's needed. I will merge, but will most likely refactor, later.

I am also not sure if it makes sense to keep the VCSH_GITIGNORE options around in the long term.

Finally, I fear we will soon be at a point where I will need to look at making a POSIX way to compare version numbers...