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

Re: MIME Type for SVG images in SVN config

From: Jan Hendrik <list.jan.hendrik_at_gmail.com>
Date: Thu, 19 Jun 2008 11:25:04 +0200

** Put back onto the list **

-- Concerning Re: MIME Type for SVG images in SVN
Kevin Grover wrote on 18 Jun 2008, 8:03, at least in part:

> On Wed, Jun 18, 2008 at 4:07 AM, Jan Hendrik <list.jan.hendrik_at_gmail.com> wrote:
> > Hi,
> >
> > recently I started working on SVG images and wonder what MIME
> > type I should have SVN ascribe for *.SVG files per config.
> >
> > Generally the regular MIME type is clear:
> >
> > *.svg = svn:mime-type=image/svg+xml
> > *.svgz = svn:mime-type=image/svg+xml
> >
> > and for the latter compressed format there is no doubt about.
> > However, according to the book SVN would handle the
> > uncompressed *.SVG as binary and therefore unmergable, too,
> > even though basically they are just text files. So what to do about?
> >
> > At this early point I merely work on SVG files just with the editor
> > (Inkscape), but supposedly that will not always be the case.
> >
> > In the archive I found a May 2004 thread which finally suggested an
> > exception for the */*+xml type to be encoded into SVN, but the
> > current manual (1.4.6) says nothing in this direction.
> >
> > Also does anyone have good recommendations for EOL setting?
> > Inkscape creates UTF-8 files with LF. I work on Windows.
> >
> > TIA,
>
> Those appear to be the correct mime types. Notice however, if you set
> the mime type to ANYTHING other than text/*, then svn will treat the
> file as binary and will no longer allow you to do diff's etc.

That's what I expected and had run into before with script files
(Javascript I think, probably also Python, where the MIME type is
something like application/*, only that for JS there are other
(deprecated/wrong?) type suggestions around, e.g. text/javascript
or text/x-python, which of course merge fine in SVN

> Unless you're serving the files via Apache and really need the mime
> types set this way, I would leave them unset. IMO having them set
> makes working with SVG files in Subversion a pain.

The repository is accessed through Apache, but I don't browse it
through Apache regularly (in a browser [e.g. Opera] I mean), so I
don't think Apache would need the MIME types from SVN
properties, but likely I don't understand things between Apache &
SVN too well.

> XML (by default) is UTF-8: if you don't specify an encoding attribute
> on the <?xml ...> line, it defaults to UTF-8. EOL (to XML) does not
> matter - it's all just whitespace. If you convert them to CR-LF
> Inkspace should not care (I have not tested this). For Subversion,
> I'm guessing that if mime-type is set to anything other than text/*
> then it will ignore eol-style (because it's a binary file in svn's
> eyes). This last is just a hunch on my part --- I'd have to verify
> it. In the end, it really does not matter unless you want to load the
> files into a text editor that DOES NOT support LF line feeds.

Homesite and SciTE do with both, only I think at least the former
will end up mixing EOL styles. The latter clearly would be the
preferred editor for SVG files anyway however.

> So, my recommendation is don't set mime type for svg files, and don't
> work about EOL style.

This seems to be a sound recommendation given the way things
are, just wanted to start out right before having to change these
things on dozens or more files a few months ahead.

Thanks, Kevin.

Jan Hendrik
---------------------------------------
Freedom quote:

     The Founding Fathers knew
     a government can't control the economy
     without controlling people.
     And they knew when a government sets out to do that,
     it must use force and coercion to achieve its purpose.
     So we have come to a time for choosing.
               -- Ronald Reagan, October 27, 1964

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-06-19 11:25:04 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.