You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by petermity <6t...@dea.spamcon.org> on 2009/05/28 21:31:16 UTC

MIME types extension matching is case-sensitive

Using Subversion/TSVN 1.6.1 under Windows XP.

I would like Subversion to set mime-types automatically.

In config I have set mime-types-file to a mime.types file from
Apache (with line-ends converted).

All of the extensions in that file are lower case.

If I add a file.jpg, it works, I get svn:mime-type of image/jpeg.

If I add a file.JPG, it doesn't work, I get svn:mime-type of
application/octet-stream.

I'd really like to use the Apache file as-is.

Is there some way to tell Subversion to match the extensions in a
case-insensitive manner?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2356587

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by petermity <6t...@dea.spamcon.org>.
petermity <6t...@dea.spamcon.org> wrote:

>petermity <6t...@dea.spamcon.org> wrote:
>
>>petermity <6t...@dea.spamcon.org> wrote:
>>
>>>petermity <6t...@dea.spamcon.org> wrote:
>>>
>>>>Ryan Schmidt <su...@ryandesign.com> wrote:
>>>>
>>>>>On Jun 2, 2009, at 03:37, Bolstridge, Andrew wrote:
>>>>>
>>>>>>>> I mean, there isn't any good reason why .jpg and .Jpg and .JPG  
>>>>>>>> should
>>>>>>>> not match to the same mime-type, right?
>>>>>>>
>>>>>>> I can't think of any good reason, and nobody else has responded.
>>>>>>
>>>>>> Frankly, I can't think why SVN isn't case-insensitive for  
>>>>>> everything. If
>>>>>> anyone has myfile.txt, Myfile.txt and MYFILE.txt in the same directory
>>>>>> they need to be told about preventative maintenance :)
>>>>>
>>>>>I believe these would all come under the umbrella of backwards- 
>>>>>incompatible changes, and thus could not be considered until  
>>>>>Subversion 2.0 at the earliest.
>>>>
>>>>I can understand that view for essential commit and other operations - but
>>>>it seems to me that for the specific case of mime-types-file extension
>>>>matching, there are unlikely to be any compatibility issues.
>>>
>>>Since there has been no further discussion - I looked in the Subversion
>>>Issue Tracker issue summaries for "case", "sensitive", and "mime", and did
>>>not see this issue listed.
>>>
>>>Should I submit this, or did I miss it as an existing issue?
>>>
>>
>>I was unable to signup to be able to enter this issue.
>>
>>Could someone else enter it?
>
>
>I guess not.  So for now I'm adding to our internal SVN documentation:
>
>
>Fix mime.types for SVN bug
>--------------------------
>
>Unfortunately, Subversion is case-sensitive right now for the
>extension, and the Apache mime.types file we use lists all
>extensions in lowercase.  So it will work fine when adding files
>with all-lowercase extensions such as my.jpg but will not set the
>mime type correctly with any other capitalization, so for
>instance for my.JPG it sets the svn:mime-type to the generic
>"application/octet-stream" instead of the expected specific
>"image/jpeg".
>
>If any of your projects might have uppercase extensions, you may
>want to obtain fixmime.pl from ... and run it via:
>
>perl fixmime.pl < mime.types > mime.types.upper
>
>and replace your profile's mime.types with that.
>
>Note that this will still only handle all upper case or all lower
>case, not a mixture.

This has now been entered:
http://subversion.tigris.org/issues/show_bug.cgi?id=3479

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2393145

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by petermity <6t...@dea.spamcon.org>.
petermity <6t...@dea.spamcon.org> wrote:

>petermity <6t...@dea.spamcon.org> wrote:
>
>>petermity <6t...@dea.spamcon.org> wrote:
>>
>>>Ryan Schmidt <su...@ryandesign.com> wrote:
>>>
>>>>On Jun 2, 2009, at 03:37, Bolstridge, Andrew wrote:
>>>>
>>>>>>> I mean, there isn't any good reason why .jpg and .Jpg and .JPG  
>>>>>>> should
>>>>>>> not match to the same mime-type, right?
>>>>>>
>>>>>> I can't think of any good reason, and nobody else has responded.
>>>>>
>>>>> Frankly, I can't think why SVN isn't case-insensitive for  
>>>>> everything. If
>>>>> anyone has myfile.txt, Myfile.txt and MYFILE.txt in the same directory
>>>>> they need to be told about preventative maintenance :)
>>>>
>>>>I believe these would all come under the umbrella of backwards- 
>>>>incompatible changes, and thus could not be considered until  
>>>>Subversion 2.0 at the earliest.
>>>
>>>I can understand that view for essential commit and other operations - but
>>>it seems to me that for the specific case of mime-types-file extension
>>>matching, there are unlikely to be any compatibility issues.
>>
>>Since there has been no further discussion - I looked in the Subversion
>>Issue Tracker issue summaries for "case", "sensitive", and "mime", and did
>>not see this issue listed.
>>
>>Should I submit this, or did I miss it as an existing issue?
>>
>
>I was unable to signup to be able to enter this issue.
>
>Could someone else enter it?


I guess not.  So for now I'm adding to our internal SVN documentation:


Fix mime.types for SVN bug
--------------------------

Unfortunately, Subversion is case-sensitive right now for the
extension, and the Apache mime.types file we use lists all
extensions in lowercase.  So it will work fine when adding files
with all-lowercase extensions such as my.jpg but will not set the
mime type correctly with any other capitalization, so for
instance for my.JPG it sets the svn:mime-type to the generic
"application/octet-stream" instead of the expected specific
"image/jpeg".

If any of your projects might have uppercase extensions, you may
want to obtain fixmime.pl from ... and run it via:

perl fixmime.pl < mime.types > mime.types.upper

and replace your profile's mime.types with that.

Note that this will still only handle all upper case or all lower
case, not a mixture.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2387785

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by petermity <6t...@dea.spamcon.org>.
petermity <6t...@dea.spamcon.org> wrote:

>petermity <6t...@dea.spamcon.org> wrote:
>
>>Ryan Schmidt <su...@ryandesign.com> wrote:
>>
>>>On Jun 2, 2009, at 03:37, Bolstridge, Andrew wrote:
>>>
>>>>>> I mean, there isn't any good reason why .jpg and .Jpg and .JPG  
>>>>>> should
>>>>>> not match to the same mime-type, right?
>>>>>
>>>>> I can't think of any good reason, and nobody else has responded.
>>>>
>>>> Frankly, I can't think why SVN isn't case-insensitive for  
>>>> everything. If
>>>> anyone has myfile.txt, Myfile.txt and MYFILE.txt in the same directory
>>>> they need to be told about preventative maintenance :)
>>>
>>>I believe these would all come under the umbrella of backwards- 
>>>incompatible changes, and thus could not be considered until  
>>>Subversion 2.0 at the earliest.
>>
>>I can understand that view for essential commit and other operations - but
>>it seems to me that for the specific case of mime-types-file extension
>>matching, there are unlikely to be any compatibility issues.
>
>Since there has been no further discussion - I looked in the Subversion
>Issue Tracker issue summaries for "case", "sensitive", and "mime", and did
>not see this issue listed.
>
>Should I submit this, or did I miss it as an existing issue?
>

I was unable to signup to be able to enter this issue.

Could someone else enter it?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2384176

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by petermity <6t...@dea.spamcon.org>.
petermity <6t...@dea.spamcon.org> wrote:

>Ryan Schmidt <su...@ryandesign.com> wrote:
>
>>On Jun 2, 2009, at 03:37, Bolstridge, Andrew wrote:
>>
>>>>> I mean, there isn't any good reason why .jpg and .Jpg and .JPG  
>>>>> should
>>>>> not match to the same mime-type, right?
>>>>
>>>> I can't think of any good reason, and nobody else has responded.
>>>
>>> Frankly, I can't think why SVN isn't case-insensitive for  
>>> everything. If
>>> anyone has myfile.txt, Myfile.txt and MYFILE.txt in the same directory
>>> they need to be told about preventative maintenance :)
>>
>>I believe these would all come under the umbrella of backwards- 
>>incompatible changes, and thus could not be considered until  
>>Subversion 2.0 at the earliest.
>
>I can understand that view for essential commit and other operations - but
>it seems to me that for the specific case of mime-types-file extension
>matching, there are unlikely to be any compatibility issues.

Since there has been no further discussion - I looked in the Subversion
Issue Tracker issue summaries for "case", "sensitive", and "mime", and did
not see this issue listed.

Should I submit this, or did I miss it as an existing issue?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2371412

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by petermity <6t...@dea.spamcon.org>.
Ryan Schmidt <su...@ryandesign.com> wrote:

>On Jun 2, 2009, at 03:37, Bolstridge, Andrew wrote:
>
>>>> I mean, there isn't any good reason why .jpg and .Jpg and .JPG  
>>>> should
>>>> not match to the same mime-type, right?
>>>
>>> I can't think of any good reason, and nobody else has responded.
>>
>> Frankly, I can't think why SVN isn't case-insensitive for  
>> everything. If
>> anyone has myfile.txt, Myfile.txt and MYFILE.txt in the same directory
>> they need to be told about preventative maintenance :)
>
>I believe these would all come under the umbrella of backwards- 
>incompatible changes, and thus could not be considered until  
>Subversion 2.0 at the earliest.

I can understand that view for essential commit and other operations - but
it seems to me that for the specific case of mime-types-file extension
matching, there are unlikely to be any compatibility issues.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2359280

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 2, 2009, at 03:37, Bolstridge, Andrew wrote:

>>> I mean, there isn't any good reason why .jpg and .Jpg and .JPG  
>>> should
>>> not match to the same mime-type, right?
>>
>> I can't think of any good reason, and nobody else has responded.
>
> Frankly, I can't think why SVN isn't case-insensitive for  
> everything. If
> anyone has myfile.txt, Myfile.txt and MYFILE.txt in the same directory
> they need to be told about preventative maintenance :)

I believe these would all come under the umbrella of backwards- 
incompatible changes, and thus could not be considered until  
Subversion 2.0 at the earliest.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2358712

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by Ed <SV...@0x1b.com>.
On Tue, Jun 2, 2009 at 3:19 AM, Bolstridge, Andrew
<an...@intergraph.com> wrote:
>> -----Original Message-----
>> From: ed.0x1b@gmail.com [mailto:ed.0x1b@gmail.com] On Behalf Of Ed
>> Sent: Tuesday, June 02, 2009 10:49 AM
>> To: Bolstridge, Andrew
>> Cc: users@subversion.tigris.org
>> Subject: Re: MIME types extension matching is case-sensitive
>>
> [snip]
>
>> Are there any other parts of Unicode space you want folded?
>> diacritical marks onto greeks maybe?
>> pardon the snark - I haven't tried detox for mime-types, but for file
>> names it really works when I get stuff from people running your kind
>> of OS, set it up as a pre-commit hook to keep the repo consistent. It
>> has a powerful rule making system -
>> http://sourceforge.net/projects/detox/
>
> Perhaps Greek users would :)
>
> Perhaps I'm showing my naiveté of foreign languages here but I imagine only Windows filesystem casing rules would be relevant as files get their case changed by things like visual studio.
>
>
> I've just had to remotely debug why one of my users was received the old MKACTIVITY denied error (serves me right for posting a criticism of case-sensitivity to the mailing list, it got its revenge not half an hour later :( ) He had the files correctly cased, but not the repo name in the URL. It allowed him to checkout, but not checkin. Maybe that's a tortoise issue and not SVN, but still... it's annoying - especially where the error message is not clear, and the issue was not one of case-insensitive filenames.
>

yes, the IDEs do have a mind of there own - and I'm afraid detox is
less of a help in any environment that uses CamelCase.

RE: MIME types extension matching is case-sensitive

Posted by "Bolstridge, Andrew" <an...@intergraph.com>.
> -----Original Message-----
> From: ed.0x1b@gmail.com [mailto:ed.0x1b@gmail.com] On Behalf Of Ed
> Sent: Tuesday, June 02, 2009 10:49 AM
> To: Bolstridge, Andrew
> Cc: users@subversion.tigris.org
> Subject: Re: MIME types extension matching is case-sensitive
> 
[snip]

> Are there any other parts of Unicode space you want folded?
> diacritical marks onto greeks maybe?
> pardon the snark - I haven't tried detox for mime-types, but for file
> names it really works when I get stuff from people running your kind
> of OS, set it up as a pre-commit hook to keep the repo consistent. It
> has a powerful rule making system -
> http://sourceforge.net/projects/detox/

Perhaps Greek users would :)  

Perhaps I'm showing my naiveté of foreign languages here but I imagine only Windows filesystem casing rules would be relevant as files get their case changed by things like visual studio.


I've just had to remotely debug why one of my users was received the old MKACTIVITY denied error (serves me right for posting a criticism of case-sensitivity to the mailing list, it got its revenge not half an hour later :( ) He had the files correctly cased, but not the repo name in the URL. It allowed him to checkout, but not checkin. Maybe that's a tortoise issue and not SVN, but still... it's annoying - especially where the error message is not clear, and the issue was not one of case-insensitive filenames.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2358717

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by Ed <SV...@0x1b.com>.
On Tue, Jun 2, 2009 at 1:37 AM, Bolstridge, Andrew
<an...@intergraph.com> wrote:
>> -----Original Message-----
>> From: news [mailto:news@ger.gmane.org] On Behalf Of petermity
>> Sent: Tuesday, June 02, 2009 7:30 AM
>> To: users@subversion.tigris.org
>> Subject: Re: MIME types extension matching is case-sensitive
>>
>> Stefan Sperling <st...@elego.de> wrote:
>>
> [snip]
>> >Why shouldn't Subversion do case-insensitive matching itself, by
>> default?
>> >Does anyone know whether the current behaviour is by design or
> whether
>> >it was just an oversight?
>> >
>> >I mean, there isn't any good reason why .jpg and .Jpg and .JPG should
>> >not match to the same mime-type, right?
>> >
>> >Stefan
>> >
>>
>> I can't think of any good reason, and nobody else has responded.
>
> Frankly, I can't think why SVN isn't case-insensitive for everything. If
> anyone has myfile.txt, Myfile.txt and MYFILE.txt in the same directory
> they need to be told about preventative maintenance :)
>

Are there any other parts of Unicode space you want folded?
diacritical marks onto greeks maybe?
pardon the snark - I haven't tried detox for mime-types, but for file
names it really works when I get stuff from people running your kind
of OS, set it up as a pre-commit hook to keep the repo consistent. It
has a powerful rule making system -
http://sourceforge.net/projects/detox/

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2358710

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: MIME types extension matching is case-sensitive

Posted by "Bolstridge, Andrew" <an...@intergraph.com>.
> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of petermity
> Sent: Tuesday, June 02, 2009 7:30 AM
> To: users@subversion.tigris.org
> Subject: Re: MIME types extension matching is case-sensitive
> 
> Stefan Sperling <st...@elego.de> wrote:
> 
[snip]
> >Why shouldn't Subversion do case-insensitive matching itself, by
> default?
> >Does anyone know whether the current behaviour is by design or
whether
> >it was just an oversight?
> >
> >I mean, there isn't any good reason why .jpg and .Jpg and .JPG should
> >not match to the same mime-type, right?
> >
> >Stefan
> >
> 
> I can't think of any good reason, and nobody else has responded.  

Frankly, I can't think why SVN isn't case-insensitive for everything. If
anyone has myfile.txt, Myfile.txt and MYFILE.txt in the same directory
they need to be told about preventative maintenance :)

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2358695

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: MIME types extension matching is case-sensitive

Posted by petermity <6t...@dea.spamcon.org>.
Stefan Sperling <st...@elego.de> wrote:

>On Fri, May 29, 2009 at 01:05:01AM +0200, Michael Diers wrote:
>> This glob expression syntax is a bit of a bummer, especially on Windows
>> where one typically wants case insensitivity.
>> 
>> Here's a way to deal with it: generate the auto-props section from a
>> proto-auto-props file that uses a simplified syntax for case-insensitive
>> globbing.
>> 
>> Example:
>> 
>> *.{doc}	svn:needs-lock=yes;svn:mime-type=application/vnd.ms-word
>> 
>> translates to
>> 
>> *.[Dd][Oo][Cc] svn:needs-lock=yes;svn:mime-type=application/vnd.ms-word
>> 
>> A very simple Perl filter script is attached.
>
>Why shouldn't Subversion do case-insensitive matching itself, by default?
>Does anyone know whether the current behaviour is by design or whether
>it was just an oversight?
>
>I mean, there isn't any good reason why .jpg and .Jpg and .JPG should
>not match to the same mime-type, right?
>
>Stefan
>

I can't think of any good reason, and nobody else has responded.  The very
reason I wanted to use the mime-types-file is to avoid lots of tweaking of
auto-props.

Is it possible then that this change could be in an upcoming 1.6.x
release?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2358659

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: MIME types extension matching is case-sensitive

Posted by Johan Corveleyn <jo...@uz.kuleuven.ac.be>.
> > This glob expression syntax is a bit of a bummer, especially on
> Windows
> > where one typically wants case insensitivity.
> >
> > Here's a way to deal with it: generate the auto-props section from a
> > proto-auto-props file that uses a simplified syntax for case-
> insensitive
> > globbing.
> >
> > Example:
> >
> > *.{doc}	svn:needs-lock=yes;svn:mime-type=application/vnd.ms-word
> >
> > translates to
> >
> > *.[Dd][Oo][Cc] svn:needs-lock=yes;svn:mime-type=application/vnd.ms-
> word
> >
> > A very simple Perl filter script is attached.
> 
> Why shouldn't Subversion do case-insensitive matching itself, by
> default?
> Does anyone know whether the current behaviour is by design or whether
> it was just an oversight?
> 
> I mean, there isn't any good reason why .jpg and .Jpg and .JPG should
> not match to the same mime-type, right?
> 
> Stefan

Has anyone confirmed that this is indeed SVN's behavior for auto-props? 
As far as I can see, this is not the case (SlikSvn 1.5.5 on Windows XP). I.e. the matching of extension happens case-insensitively (at least on Windows).
See output below:

-------------------
$ tail config
# *.png = svn:mime-type=image/png
# *.jpg = svn:mime-type=image/jpeg
# Makefile = svn:eol-style=native
*.java = svn:eol-style=native
*.txt = svn:eol-style=native
*.xml = svn:eol-style=native
*.xsl = svn:eol-style=native
*.properties = svn:eol-style=native
*.props = svn:eol-style=native
*.jnlp = svn:eol-style=native
*.sql = svn:eol-style=native

$ echo test > mytest.java

$ svn add mytest.java
A         mytest.java

$ svn pl -v mytest.java
Properties on 'mytest.java':
  svn:eol-style : native

$ echo test > mytest2.JAVA

$ svn add mytest2.JAVA
A         mytest2.JAVA

$ svn pl -v mytest2.JAVA
Properties on 'mytest2.JAVA':
  svn:eol-style : native

$ echo test > mytest3.jAvA

$ svn add mytest3.jAvA
A         mytest3.jAvA

$ svn pl -v mytest3.jAvA
Properties on 'mytest3.jAvA':
  svn:eol-style : native

-------------------

Now, I don't know about using the mime-types feature (I don't use that), but for auto-props there is no issue AFAICS.

Regards,
Johan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2356742

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: MIME types extension matching is case-sensitive

Posted by Stefan Sperling <st...@elego.de>.
On Fri, May 29, 2009 at 01:05:01AM +0200, Michael Diers wrote:
> This glob expression syntax is a bit of a bummer, especially on Windows
> where one typically wants case insensitivity.
> 
> Here's a way to deal with it: generate the auto-props section from a
> proto-auto-props file that uses a simplified syntax for case-insensitive
> globbing.
> 
> Example:
> 
> *.{doc}	svn:needs-lock=yes;svn:mime-type=application/vnd.ms-word
> 
> translates to
> 
> *.[Dd][Oo][Cc] svn:needs-lock=yes;svn:mime-type=application/vnd.ms-word
> 
> A very simple Perl filter script is attached.

Why shouldn't Subversion do case-insensitive matching itself, by default?
Does anyone know whether the current behaviour is by design or whether
it was just an oversight?

I mean, there isn't any good reason why .jpg and .Jpg and .JPG should
not match to the same mime-type, right?

Stefan

Re: MIME types extension matching is case-sensitive

Posted by Michael Diers <md...@elego.de>.
Ryan Schmidt wrote:
> On May 28, 2009, at 16:31, petermity wrote:
> 
>> Using Subversion/TSVN 1.6.1 under Windows XP.
>>
>> I would like Subversion to set mime-types automatically.
>>
>> In config I have set mime-types-file to a mime.types file from
>> Apache (with line-ends converted).
>>
>> All of the extensions in that file are lower case.
>>
>> If I add a file.jpg, it works, I get svn:mime-type of image/jpeg.
>>
>> If I add a file.JPG, it doesn't work, I get svn:mime-type of
>> application/octet-stream.
>>
>> I'd really like to use the Apache file as-is.
>>
>> Is there some way to tell Subversion to match the extensions in a
>> case-insensitive manner?
> 
> I don't know. I had not been aware of mime-types-file; looks like  
> this option is new for subversion 1.5. Prior to this, the only way to  
> set mime types automatically was to use the auto-props section in the  
> subversion config file. My config file is still set up in this way,  
> containing rules such as these:
> 
> 
> [auto-props]
> 
> *.[Cc][Ss][Ss] = svn:eol-style=native;svn:mime-type=text/css
> *.[Gg][Ii][Ff] = svn:mime-type=image/gif
> *.[Hh][Tt][Mm] = svn:eol-style=native;svn:mime-type=text/html
> *.[Hh][Tt][Mm][Ll] = svn:eol-style=native;svn:mime-type=text/html
> *.[Jj][Pp][Ee][Gg] = svn:mime-type=image/jpeg
> *.[Jj][Pp][Gg] = svn:mime-type=image/jpeg
> *.[Jj][Ss] = svn:eol-style=native;svn:mime-type=text/javascript
> 
> 
> And so on. Note the use of glob expressions at the beginning to match  
> extensions case-insensitively. I know subversion treats these rules  
> case-sensitively otherwise. I don't know about its handling of mime- 
> types-file.

This glob expression syntax is a bit of a bummer, especially on Windows
where one typically wants case insensitivity.

Here's a way to deal with it: generate the auto-props section from a
proto-auto-props file that uses a simplified syntax for case-insensitive
globbing.

Example:

*.{doc}	svn:needs-lock=yes;svn:mime-type=application/vnd.ms-word

translates to

*.[Dd][Oo][Cc] svn:needs-lock=yes;svn:mime-type=application/vnd.ms-word

A very simple Perl filter script is attached.

-- 
Michael Diers, Software Developer

elego Software Solutions GmbH, http://www.elego.de

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2356611

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: MIME types extension matching is case-sensitive

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 28, 2009, at 16:31, petermity wrote:

> Using Subversion/TSVN 1.6.1 under Windows XP.
>
> I would like Subversion to set mime-types automatically.
>
> In config I have set mime-types-file to a mime.types file from
> Apache (with line-ends converted).
>
> All of the extensions in that file are lower case.
>
> If I add a file.jpg, it works, I get svn:mime-type of image/jpeg.
>
> If I add a file.JPG, it doesn't work, I get svn:mime-type of
> application/octet-stream.
>
> I'd really like to use the Apache file as-is.
>
> Is there some way to tell Subversion to match the extensions in a
> case-insensitive manner?

I don't know. I had not been aware of mime-types-file; looks like  
this option is new for subversion 1.5. Prior to this, the only way to  
set mime types automatically was to use the auto-props section in the  
subversion config file. My config file is still set up in this way,  
containing rules such as these:


[auto-props]

*.[Cc][Ss][Ss] = svn:eol-style=native;svn:mime-type=text/css
*.[Gg][Ii][Ff] = svn:mime-type=image/gif
*.[Hh][Tt][Mm] = svn:eol-style=native;svn:mime-type=text/html
*.[Hh][Tt][Mm][Ll] = svn:eol-style=native;svn:mime-type=text/html
*.[Jj][Pp][Ee][Gg] = svn:mime-type=image/jpeg
*.[Jj][Pp][Gg] = svn:mime-type=image/jpeg
*.[Jj][Ss] = svn:eol-style=native;svn:mime-type=text/javascript


And so on. Note the use of glob expressions at the beginning to match  
extensions case-insensitively. I know subversion treats these rules  
case-sensitively otherwise. I don't know about its handling of mime- 
types-file.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2356601

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].