You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Hendrik Maryns <qw...@sneakemail.com> on 2008/09/17 14:02:43 UTC

Re: MIME types

Hendrik Maryns schreef:
> Hi all,
> 
> After two questions on the Subclipse list/group today, I started reading
> about how Subversion handles mime types.  It seems like I have to
> provide it with a mime-types-mapping file.  A file like that is present
> in Gnome, though.  Why doesn’t Subversion consider this file by default?
>  I suppose KDE has a similar ssystem set up?  Why ask the user to
> configure this file by hand?
> 
> Second question: is it useful to enter more specific MIME types then the
> generic application/octet-stream?  Does it make any difference anywhere
> if it says image/png or application/x-tex?  The latter might be
> problematic, I suppose, since it doesn’t say ‘text’, although a TeX file
> is text only and should not be excluded from contextual merge.
> 
> Cheers, H.

This was supposed to go to the general Subversion users group.

H.
-- 
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


Re: MIME types

Posted by Jan Hendrik <li...@gmail.com>.
Concerning Re: MIME types
Greg Thomas wrote on 18 Sep 2008, 11:01, at least in part:

> On Thu, 18 Sep 2008 11:53:47 +0200, "Jan Hendrik"
> <li...@gmail.com> wrote:
> 
> >But then how about those application/javascript or image/svg+xml down
> >to application/xhtml+xml types which (almost always?) are plain text
> >files SVN could but would not merge?
> 
> That's the second question; 
> 
> Either 
> (a) ISTR you can use the --force parameter, which forces merging of
> files svn believes to be binary, or

I have not checked --force, but yet it would not be so easy.  What 
about an update where both pseudo binaries as above and actual 
binaries, e.g. PNG, JPEG, SVG.GZ, are involved?  One would 
never be able to be sure beforehand or would have to do it file by 
file or enforce some setting that the latter require locking (which 
would be rather weak given that these settings are on the client 
side).

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

     They that are on their guard and appear
     ready to receive their adversaries,
     are in much less danger of being attacked
     than the supine, secure and negligent.
               -- Benjamin Franklin


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: MIME types

Posted by Greg Thomas <th...@omc.bt.co.uk>.
On Thu, 18 Sep 2008 11:53:47 +0200, "Jan Hendrik"
<li...@gmail.com> wrote:

>But then how about those application/javascript or image/svg+xml 
>down to application/xhtml+xml types which (almost always?) are 
>plain text files SVN could but would not merge?

That's the second question; 

Either 
(a) ISTR you can use the --force parameter, which forces merging of
files svn believes to be binary, or
(b) Wait until
http://subversion.tigris.org/issues/show_bug.cgi?id=1002 is fixed.

Greg
-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: MIME types

Posted by Jan Hendrik <li...@gmail.com>.
Concerning Re: MIME types
Greg Thomas wrote on 18 Sep 2008, 9:52, at least in part:

> The point from the OP was that why do you have to specify MIME types
> in the auto props file when the OS (Linux in the case to hand) already
> has a mapping of file extenstion -> MIME type.

But then how about those application/javascript or image/svg+xml 
down to application/xhtml+xml types which (almost always?) are 
plain text files SVN could but would not merge?

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

     Wir haben die Wahl zwischen Sklaverei und Freiheit,
     wir wählen die Freiheit.
               -- Konrad Adenauer, Regierungserklärung 1952


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: MIME types

Posted by Greg Thomas <th...@omc.bt.co.uk>.
On Thu, 18 Sep 2008 00:00:56 -0500, Ryan Schmidt
<su...@ryandesign.com> wrote:

>
>On Sep 17, 2008, at 09:33, Greg Thomas wrote:
>>
>> I wonder if a post-commit hook to add an appropriate MIME type to all
>> files just "A"dded is the easiest option?
>
>No, it would not. The server would have to maintain its own working  
>copy and commit a second revision immediately after a revision that  
>added a file without a mime type.

That's where http://subversion.tigris.org/issues/show_bug.cgi?id=2238
comes in.

Greg
-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: MIME types

Posted by Greg Thomas <th...@omc.bt.co.uk>.
On Thu, 18 Sep 2008 00:00:56 -0500, Ryan Schmidt
<su...@ryandesign.com> wrote:

>You can automate this on the client side using the auto- 
>props section of the config file.

The point from the OP was that why do you have to specify MIME types
in the auto props file when the OS (Linux in the case to hand) already
has a mapping of file extenstion -> MIME type.

Greg
-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: MIME types

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 17, 2008, at 09:33, Greg Thomas wrote:

>>> After two questions on the Subclipse list/group today, I started  
>>> reading
>>> about how Subversion handles mime types.  It seems like I have to
>>> provide it with a mime-types-mapping file.  A file like that is  
>>> present
>>> in Gnome, though.  Why doesn’t Subversion consider this file by  
>>> default?
>>>  I suppose KDE has a similar ssystem set up?  Why ask the user to
>>> configure this file by hand?
>
> I wonder if a post-commit hook to add an appropriate MIME type to all
> files just "A"dded is the easiest option?

No, it would not. The server would have to maintain its own working  
copy and commit a second revision immediately after a revision that  
added a file without a mime type.

It is better to make the committer use the proper mime type in the  
first place. You can automate this on the client side using the auto- 
props section of the config file. You can enforce it on the server  
side by writing a pre-commit hook to reject any commit that does not  
match your requirements.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: MIME types

Posted by Greg Thomas <th...@omc.bt.co.uk>.
On Wed, 17 Sep 2008 16:02:43 +0200, Hendrik Maryns
<qw...@sneakemail.com> wrote:

>Hendrik Maryns schreef:
>> Hi all,
>> 
>> After two questions on the Subclipse list/group today, I started reading
>> about how Subversion handles mime types.  It seems like I have to
>> provide it with a mime-types-mapping file.  A file like that is present
>> in Gnome, though.  Why doesn’t Subversion consider this file by default?
>>  I suppose KDE has a similar ssystem set up?  Why ask the user to
>> configure this file by hand?

I wonder if a post-commit hook to add an appropriate MIME type to all
files just "A"dded is the easiest option?
 
>> Second question: is it useful to enter more specific MIME types then the
>> generic application/octet-stream?  Does it make any difference anywhere
>> if it says image/png or application/x-tex?  The latter might be
>> problematic, I suppose, since it doesn’t say ‘text’, although a TeX file
>> is text only and should not be excluded from contextual merge.

If you're using Apache to access your repository, then the correct
MIME type is presented to the browser; this means you can browse
directly to your PNG file and see it rendered.

http://subversion.tigris.org/faq.html#binary-files is also relevant
here, too (though IIRC more recent versions of the svn client allow
you to use the --force qualifier to attempt merging/diffing/blaming of
binary files).

Greg
-- 
This post represents the views of the author and does
not necessarily accurately represent the views of BT.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: MIME types

Posted by Hendrik Maryns <qw...@sneakemail.com>.
Hendrik Maryns schreef:
> Hendrik Maryns schreef:
>> Hi all,
>>
>> After two questions on the Subclipse list/group today, I started reading
>> about how Subversion handles mime types.  It seems like I have to
>> provide it with a mime-types-mapping file.  A file like that is present
>> in Gnome, though.  Why doesn’t Subversion consider this file by default?
>>  I suppose KDE has a similar ssystem set up?  Why ask the user to
>> configure this file by hand?
>>
>> Second question: is it useful to enter more specific MIME types then the
>> generic application/octet-stream?  Does it make any difference anywhere
>> if it says image/png or application/x-tex?  The latter might be
>> problematic, I suppose, since it doesn’t say ‘text’, although a TeX file
>> is text only and should not be excluded from contextual merge.
>>
>> Cheers, H.
> 
> This was supposed to go to the general Subversion users group.

Let me add to this that I have now read the thread ‘Action request:
mime-type of xml-dtd should be treated as text’ and do not agree with
those that are against treating xml as text.  Even more: a lot of their
arguments are void for TeX file, there is for example NO text/ mime type
for TeX files, the only valid ones are application/x-tex and
application/x-latex.

Similarly: the argument: ‘don’t do it’ is also void: if a tool purports
to support something, it should support it properly, and not redefine
the meaning of it.  Mime types are NOT meant to distinguish between
binary and text files.

H.
-- 
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


Re: MIME types

Posted by Jan Hendrik <li...@gmail.com>.
Concerning Re: MIME types
Hendrik Maryns wrote on 17 Sep 2008, 16:02, at least in part:

> Hendrik Maryns schreef:

> > Second question: is it useful to enter more specific MIME types then
> > the generic application/octet-stream?  Does it make any difference
> > anywhere if it says image/png or application/x-tex?  The latter
> > might be problematic, I suppose, since it doesn’t say ‘text’,
> > although a TeX file is text only and should not be excluded from
> > contextual merge.

Had the same issue with javascript and SVG files.  For the latter I 
ended up commenting out the MIME setting, for the former I fell 
back to the deprecated text/javascript.  Dunno what good it does in 
either case, probably there is some relevance when browsing the 
repository.  For binary files like images or PDF I guess it is better 
to set a MIME type of at least application/something so that by 
any chance SVN does not consider it as ASCII.  And then one can 
do it right and set the correct MIME type ...

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

     It is our attitude toward free thought and free expression
     that will determine our fate. There must be no limit on the range
     of temperate discussion, no limits on thought. No subject must be taboo.
     No censor must preside at our assemblies.
               -- William O. Douglas
                  U.S. Supreme Court Justice, 1898-1980


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org