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

Re: Towards standardising mime-type support

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-04-01 01:28:31 CEST

Trent Apted wrote:

> Hi there, I've been a developer and CVS user for a long time and
> recently did the switch to Subversion
> [svn, version 1.1.3 (r12730)]. Some things bug be (being unable to
> move things between repositories comes to mind), but overall I'm happy
> and it is now unlikely that I'll go back to CVS (it was a close thing
> though).
>
> I'm currently in the process of reading through the docs to get the
> most out of Subversion. I came across the svn:mime-types property and
> my immediate thought was, "Why don't I just use /usr/bin/file to set
> the mime-type?" So I tried it out, but there are some issues:
>
> When I run
>
> $ file -bi something.c
>
> (or .cpp, .h, .cc, etc.)
>
> /usr/bin/file reports that the mime-type for C/C++ files is
>
> text/x-c; charset=us-ascii

Well, this is clearly wrong, there's no such thing as a "text/x-c" mime
type.

> However, if I feed this to Subversion, it treats the file as binary.
> So, that's fine, I'll drop the charset stuff,

Ah, yes, We should know about charset attributes.

> and things are mostly back to normal, but the added information still
> appears to be meaningless to Subversion.

Define "meaningless". You've told SVN that this is a text file, and
that's it. SVN doesn't interpret the mime type any further than that (yet).

> Also, trac did not understand the text/x-c mime-type

Like I said, it's not a valid mime type.

> and refused to run the file through enscript, so I ended up deleting
> the mime-type altogether. This is bad, because I can foresee a future
> application that can take full advantage of such mime-type strings.

You should complain about this to the Trac people, not here. Trac isn't
Subversion.

> So perhaps, to future-proof the mime-types, the parsing should be able
> to treat any string that fits the standard in a sane way .. even if it
> just ignores some of it (like charsets).

I agree about the charset attribute, see above.

> Further, perhaps there should be a feature with support for
> `/usr/bin/file -bi` --- "auto-auto-props" might be nice.

We've talked about using platform-specific mechanisms to guess the mime
type. What's missing is somebody with enough time on their hands to
actually do this.

> The current method doesn't really add much over the cvswrappers
> technique which always seemed to be a big duplication of effort to me.

So it is.

> The trac problem is less urgent, I might bug those guys later..
>
> Cheers,
> Trent.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>

-- 
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Apr 1 01:31:22 2005

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.