On Tue, Nov 19, 2013 at 11:23:39PM -0800, Ben Reser wrote:
> I suggest that we do two things:
> 
> 1) update our defaults for some mime types to be text
> 
> 2) make which mime types are treated as text user configurable with a new 
> "text-types" category in ~/.subversion/config.  Keys would be mime-types or 
> globs for types and values would be booleans (true if type is text).  
> Unmatched types would behave poet built in details.  Built in text types 
> could be overridden by adding an entry and setting it to false.
> 
> Most people will expect XML to be treated as text.  So this helps them.  
> While leaving people who want a way to preserve existing behavior a way to 
> revert.  It also means we don't necessarily have to have perfect defaults.
> 
> Lastly this might also be nice to support as a server directed configuration 
> via a svn:texts types property.
> 
> Thoughts?

Hmm... I don't see a need to change anything.

libmagic is used as a last resort. Subversion already offers several
ways of configuring the svn:mime-type property, all of which supersede
libmagic (svn propset/propedit, auto-props, svn:auto-props).
So unless there is a really good reason why any of these cannot be used,
I think we should tell our users to configure their clients appropriately.

Additionally, users can use their own MAGIC files to control what
mime-types libmagic gives to Subversion. We don't need to replicate
this functionality in Subversion itself.

libmagic uses a heuristic, so it can get things wrong. But if we start
filtering libmagic output for the purpose of treating XML documents
as text, we could eventually end up with a huge list of hard-coded
exceptions for all sorts of things. Where do we stop? How can we make
sure that everyone will be happy with a list we make up?
The whole point of relying on libmagic is to avoid such a list.

Reply via email to