Re: [PATCH] Make !pattern in .gitattributes non-fatal
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 1, 2013, 20:28 UTC
- Message-ID
- <7vfw0eg90e.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <a1679159dbe67c34675bbe016e131260310db189.1362168366.git.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
Show 18 quoted lines
> Before 82dce99 (attr: more matching optimizations from .gitignore, > 2012-10-15), .gitattributes did not have any special treatment of a > leading '!'. The docs, however, always said > > The rules how the pattern matches paths are the same as in > `.gitignore` files; see linkgit:gitignore[5]. > > By those rules, leading '!' means pattern negation. So 82dce99 > correctly determined that this kind of line makes no sense and should > be disallowed. > > However, users who actually had a rule for files starting with a '!' > are in a bad position: before 82dce99 '!' matched that literal > character, so it is conceivable that users have .gitattributes with > such lines in them. After 82dce99 the unescaped version was > disallowed in such a way that git outright refuses to run(!) most > commands in the presence of such a .gitattributes. It therefore > becomes very hard to fix, let alone work with, such repositories.
Fixing the working tree is easy, but when we read from a history that already records such an entry in an attribute file, it would become somewhat cumbersome. I wouldn't use "very hard to fix" to describe such a case.
But the demotion to warning does make sense; let's do that in v1.8.1.5.