From: Junio C Hamano Date: Thu, 25 Aug 2011 22:57:06 GMT Subject: Re: [RFC/PATCH] attr: map builtin userdiff drivers to well-known extensions Message-ID: <7v8vqhhzgd.fsf@alter.siamese.dyndns.org> In-Reply-To: <20110825204047.GA9948@sigill.intra.peff.net> Jeff King writes: > If you have any matching attribute line in your own files, it should > override. So: > > foo/* -diff > > will still mark foo/bar.c as binary, even with this change. > > Can anyone think of other possible side effects? > > Also, any other extensions that would go into such a list? I have no > idea what the common extension is for something like pascal or csharp. As long as the builtin ones are the lowest priority fallback, we should be Ok. Do we say anywhere that "Ah, this has 'diff' attribute defined, so it must be text"? If so, we should fix _that_. In other words, having this one extra entry "* diff=default" in the builtin_attr[] array should be a no-op, I think. > > attr.c | 12 ++++++++++++ > 1 files changed, 12 insertions(+), 0 deletions(-) > > diff --git a/attr.c b/attr.c > index da29c8e..5118a14 100644 > --- a/attr.c > +++ b/attr.c > @@ -294,6 +294,18 @@ static void free_attr_elem(struct attr_stack *e) > > static const char *builtin_attr[] = { > "[attr]binary -diff -text", > + "*.html diff=html", > + "*.java diff=java", > + "*.perl diff=perl", > + "*.pl diff=perl", > + "*.php diff=php", > + "*.py diff=python", > + "*.rb diff=ruby", > + "*.bib diff=bibtex", > + "*.tex diff=tex", > + "*.c diff=cpp", > + "*.cc diff=cpp", > + "*.cxx diff=cpp", > NULL, > };