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

Re: Bug report: The auto-props setting of svn:mime-type is impossible to avoid.

From: Edward d'Auvergne <true.bugman_at_gmail.com>
Date: Sat, 3 Oct 2015 10:25:04 +0200

On 2 October 2015 at 11:33, Stefan Sperling <stsp_at_elego.de> wrote:
> On Fri, Oct 02, 2015 at 10:06:26AM +0200, Edward d'Auvergne wrote:
>> Hi all,
>> I was wondering if this should be considered a bug. At the FlightGear
>> project we have a 6 GB data svn repository for aircraft (
>> https://sourceforge.net/projects/flightgear/ ,
>> https://sourceforge.net/p/flightgear/fgaddon/HEAD/tree/ ). A large
>> quantity of the files, almost 30,000 in number, are XML text files.
>> The problem is that modern Subversion clients appear to all be using
>> libmagic to determine the file type, to then set the svn:mime-type
>> property. However this is rather problematic:
>> $ file -ib Aircraft/747-400/747-400-set.xml
>> application/xml; charset=us-ascii
>> Libmagic detects all these XML files as "application/xml". Hence they
>> are treated as binary files! There are many other text files with
>> extensions such as *.ac, *.nas, etc. present in the repository that in
>> the future might be detected by libmagic as "application/xyz".
>> We have looked at disabling [auto-props] both as the user in
>> ~/.subversion/config and as root in /etc/subversion/config by setting:
>> enable-auto-props = no
>> And by commenting out the entirety of the [auto-props] section.
>> However this does not prevent svn:mime-type from being set on all
>> files.
>> As this bad behaviour can be so incredibly damaging for this
>> repository, I have written pre-commit repository hook script to
>> specifically to block any file that enters the data repository that
>> has svn:mime-type set (
>> http://thread.gmane.org/gmane.games.flightgear.devel/77606/focus=77796
>> ). I also block svn:executable in another script. Below I'll give a
>> worked example that anyone can use and replicate this problem with.
>> The problem is that Subversion clients setting svn:mime-type
>> automatically, even when told not to, and the hook script catching
>> this causes a lot of developer confusion and prevents the use of 'svn
>> import'.
>> I was wondering if there was anything that has been missed here? Is
>> this a real bug? The svn:mime-type property is not needed and is not
>> desired for any file in this repository. Any help would be
>> appreciated.
>> Cheers,
>> Edward
> Hi Edward,
> the pre-commit hook script you wrote blocks commits using an
> undesired client configuration, so that's a good first step.

Hi Stefan,

Thanks for the detailed response!

> For the second step, there are several ways of tweaking the client-side
> behaviour. I hope at least one of these alternatives will help you.
> - compile SVN without libmagic support

Unfortunately this is difficult. The FlightGear (FG) aircraft
collection contains about 500 aircraft, mostly by different and
multiple authors. So we have GNU/Linux, Mac OS X, and MS Windows
users/developers. And we have users of the command line svn clients
and GUI tools. Standard svn, KDESvn, SlikSVN, TortoiseSVN, the list
goes on... The huge diversity limits the practical options.

> - write you own magic file and use the MAGIC environment variable
> to point svn at it, setting the desired mime-type for XML files

This might work. I'll soon try out Philip's suggestion and see how
that works. I'm not sure how this will work with the GUI clients.

> - configure autoprops for *.xml in ~/.subversion/config to set
> the svn:mime-type property to 'text/plain'.
> Autoprops always override automatic detection with libmagic.

From the perspective of Subversion users, libmagic is a 3rd party. We
cannot trust them to not change the magic file again to something that
treats text files in svn as binary files. This FG aircraft repository
is one of the biggest version controlled repositories in the open
source world, by far. It has an incredible diversity of text files
with different extensions, and we would like these to forever be
treated as text. Due to the bad behaviour of libmagic, banning
svn:mime-type from the FG repository is the only practical option.

> - set 'enable-magic-file = no' in ~/.subversion/config
> This option exists only as of Subversion 1.9, I believe.
> Consider the following trick to view a default configuration in the
> file /tmp/svncfg/config, which lists all available options in your
> current version of svn, with comments explaining their purpose:
> svn help --config-dir /tmp/svncfg
> less /tmp/svncfg/config

This sounds like an option, but not many of the FG aircraft developers
will have access to this. For example I'm using Mageia Linux 5, which
was only released a few months ago, that this ships with svn, version
1.8.14 (r1692801). However the option:

    enable-auto-props = no

Should be equivalent of:

    disable-auto-props = yes

I do not know why when telling the svn client to not use auto-props,
the svn client ignores you and uses auto-props anyway. To me this
looks like a bug (I hope the Subversion developers read this list).


Received on 2015-10-03 10:25:17 CEST

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

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