[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn_mime_type_is_binary, libmagic and application/xml

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 20 Nov 2013 08:39:09 +0100

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.
Received on 2013-11-20 08:39:51 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.