You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kamesh Jayachandran <ka...@collab.net> on 2007/05/21 15:06:11 UTC

[PATCH]Why do we store svn config section options in a case insensitive way?

Hi All,
I have seen one of our client trying to set 'svn:eol-style' to 'native' 
for all 'makefile', 'Makefile' and all possible variants using autoprops.
It does not work in svn currently.

<snip>
$cat ~/.subversion/config
[miscellany]
enable-auto-props = yes

[auto-props]
makefile* = svn:eol-style=native
Makefile* = svn:eol-style=native

WC$svn add Makefile
#This does not set the property 'svn:eol-style' on 'Makefile'.

WC$svn add makefile
#This does set the property 'svn:eol-style' on 'makefile'.

In essence autoprops for patterns differing only in case breaks all the 
autoprops setting except the first one in the definition. Here autoprops 
is active only for 'makefile*' not 'Makefile*'.
</snip>

I tried '[mM][aA][kK][eE][fF][iI][lL][eE] = svn:eol-style=native' inside 
the autoprops section, but it got confused to be a different section due 
to preceding '['.

I have a patch which fixes the problem by populating the 
section->options in a case sensitive keys. Find it attached.

Ran 'make check', it went well.

With regards
Kamesh Jayachandran

Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by Michael Haggerty <mh...@alum.mit.edu>.
Issue #2036 is caused by the same issues being discussed here.  See

    http://subversion.tigris.org/issues/show_bug.cgi?id=2036

Garrett Rooney wrote:
> On 5/21/07, C. Michael Pilato <cm...@collab.net> wrote:
>> That's true, but to what degree do we care?  We've only ever
>> publicized our
>> option names in lower-case form -- in samples, documentation, and
>> discussion.  So why would somebody choose to use a different form? 
>> Simply
>> because they tried it and nothing fell completely over (for them)? 
>> Shame on
>> them.
> 
> The last time this came up I asked DLR about it and he said it was
> because the python config parser format (which we copied, and which
> we've always used as the docs for the format) has case insensitive
> keys.

That's not true anymore.  The default for Python's ConfigParser is still
case-insensitive, but as of Python 2.1, there is a documented way to
make it case-sensitive (by setting an optionxform() attribute on the
ConfigParser instance).  We confronted this issue in cvs2svn, which has
an option to use auto-props to set properties on files being converted.
 See thread

    http://subversion.tigris.org/issues/show_bug.cgi?id=2036

for a discussion.  In the end, I punted on the issue by adding a second
option that lets the user decide whether to treat options
case-sensitively.  The understanding over in cvs2svn-land was that once
SVN makes a decision we would match our behavior to SVN's.

Let me also remind people that auto-prop processing is a client-side
feature.  Therefore it wouldn't be so preposterous to treat filename
patterns as case-sensitive on operating systems where filenames are case
sensitive, and case-insensitive on certain other lame OSs.

Michael

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

Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 5/21/07, C. Michael Pilato <cm...@collab.net> wrote:

> That's true, but to what degree do we care?  We've only ever publicized our
> option names in lower-case form -- in samples, documentation, and
> discussion.  So why would somebody choose to use a different form?  Simply
> because they tried it and nothing fell completely over (for them)?  Shame on
> them.

The last time this came up I asked DLR about it and he said it was
because the python config parser format (which we copied, and which
we've always used as the docs for the format) has case insensitive
keys.

-garrett

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

Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Malcolm Rowe wrote:
> Well, we've said that we're compatible with the Python ConfigParser
> format, and, as far as I'm aware, that has case-insensitive option names
> (though it _does_ have case-sensitive section names, which we don't have).
> 
> This issue also bites authz.  I'd be happy to change it, but I didn't
> think that was an option.  (See previous emails on dev@ from e.g.
> Branko).

Hrm.  Trac and ViewVC now both parse Subversion authz files with Python.  So
there is value to keeping those things the same.  :-(

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Mon, May 21, 2007 at 11:57:57AM -0400, C. Michael Pilato wrote:
> Malcolm Rowe wrote:
> > On Mon, May 21, 2007 at 08:36:11PM +0530, Kamesh Jayachandran wrote:
> >> SVN config section option names are treated in a case insensitive way. This
> >> breaks autoprops setting on a patterns which differs only in case.
> >>
> > 
> > The first statement is true; the second is a corollary of the first.
> > Your patch breaks config files that don't use lower case option names,
> > doesn't it?
> 
> That's true, but to what degree do we care?  We've only ever publicized our
> option names in lower-case form -- in samples, documentation, and
> discussion.  So why would somebody choose to use a different form?  Simply
> because they tried it and nothing fell completely over (for them)?  Shame on
> them.
> 

Well, we've said that we're compatible with the Python ConfigParser
format, and, as far as I'm aware, that has case-insensitive option names
(though it _does_ have case-sensitive section names, which we don't have).

This issue also bites authz.  I'd be happy to change it, but I didn't
think that was an option.  (See previous emails on dev@ from e.g.
Branko).

Regards,
Malcolm

Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by Norbert Unterberg <nu...@gmail.com>.
2007/5/21, Malcolm Rowe <ma...@farside.org.uk>:
> On Mon, May 21, 2007 at 12:24:29PM -0400, C. Michael Pilato wrote:
> > > Silently ignoring config options because the case is wrong seems bad, IMO.
> > >
> > > I think it'd be better to normalize filenames before checking the
> > > autoprops code.  This would mean that we lose case-sensitivity on the
> > > applicability of the autoprops, but I view that as a far lesser evil.
> > > -- justin
> >
> > Yeah, I think I have to agree.  For one thing, it's easy to document that
> > our autoprop application is done case-insensitively.  But secondly, folks
> > might actually *prefer* this most of the time, even, especially if their
> > repositories are prone to winding up with upper-cased filenames thanks to
> > some Windows software.
> >
>
> +1.  Given the inability to have different rules for differently-cased
> versions of a filename, I don't see why we shouldn't ignore case when
> determining the applicability of an autoprop rule too.

BTW, what is the encoding of config files? UTF-8 or the user's local
code page? Because encoding matters when doing text conversions.

Norbert

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

Re: [PATCH]Why do we store svn config section options in a caseinsensitive way?

Posted by Carlos Alberto Costa Beppler <be...@gmail.com>.
On Windows, if you are using registry to store the autoprops, you
can“t have difference only on case sensitivity, but case sensitivity
is a problem everywhere on Subversion on Windows.


2007/5/22, Kamesh Jayachandran <ka...@collab.net>:
>
>
>
>
> >+1.  Given the inability to have different rules for differently-cased
>  >versions of a filename, I don't see why we shouldn't ignore case when
>  >determining the applicability of an autoprop rule too.
>  >
>  >Regards,
>  >Malcolm
>
>
>  Thanks all. Attaching the patch in the direction suggested by Justin.
>
>  With regards
>  Kamesh Jayachandran
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

Re: [PATCH]Why do we store svn config section options in a caseinsensitive way?

Posted by Daniel Rall <dl...@collab.net>.
On Wed, 23 May 2007, Kamesh Jayachandran wrote:

> >Kamesh, +1 to commit your patch along with something like the above.
> 
> Thanks Dan. Committed at r25124.
> 
> I would like this backported to 1.4.x.
> 
> Can you point me to the steps to do the same?

http://subversion.tigris.org/hacking.html#release-stabilization

Re: [PATCH]Why do we store svn config section options in a caseinsensitive way?

Posted by Michael Haggerty <mh...@alum.mit.edu>.
Kamesh Jayachandran wrote:
>>Kamesh, +1 to commit your patch along with something like the above.
> 
> Thanks Dan. Committed at r25124.
> 
> I would like this backported to 1.4.x.
> 
> Can you point me to the steps to do the same?

Kamesh,

I bet that your change fixes issue #2036.

Michael

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

RE: [PATCH]Why do we store svn config section options in a caseinsensitive way?

Posted by Kamesh Jayachandran <ka...@collab.net>.
>Kamesh, +1 to commit your patch along with something like the above.

Thanks Dan. Committed at r25124.

I would like this backported to 1.4.x.

Can you point me to the steps to do the same?

With regards
Kamesh Jayachandran


Re: [PATCH]Why do we store svn config section options in a caseinsensitive way?

Posted by Daniel Rall <dl...@collab.net>.
On Tue, 22 May 2007, Kamesh Jayachandran wrote:

> >+1.  Given the inability to have different rules for differently-cased
> >versions of a filename, I don't see why we shouldn't ignore case when
> >determining the applicability of an autoprop rule too.
> >
> >Regards,
> >Malcolm
> 
> 
> Thanks all. Attaching the patch in the direction suggested by Justin.

I'm in favor of this change.  Kamesh's patch looks good, but I think
it needs a companion change like this to indicate in the
auto-generated config file that auto-props are applied
case-insensitively:

Index: subversion/libsvn_subr/config_file.c
===================================================================
--- subversion/libsvn_subr/config_file.c        (revision 25117)
+++ subversion/libsvn_subr/config_file.c        (working copy)
@@ -984,9 +984,10 @@
         "### The format of the entries is:"                                  NL
         "###   file-name-pattern = propname[=value][;propname[=value]...]"   NL
         "### The file-name-pattern can contain wildcards (such as '*' and"   NL
-        "### '?').  All entries which match will be applied to the file."    NL
-        "### Note that auto-props functionality must be enabled, which"      NL
-        "### is typically done by setting the 'enable-auto-props' option."   NL
+        "### '?').  All entries which match (case-insensitively) will be"    NL
+        "### applied to the file.  Note that auto-props functionality"       NL
+        "### must be enabled, which is typically done by setting the"        NL
+        "### 'enable-auto-props' option."                                    NL
         "# *.c = svn:eol-style=native"                                       NL
         "# *.cpp = svn:eol-style=native"                                     NL
         "# *.h = svn:eol-style=native"                                       NL


Kamesh, +1 to commit your patch along with something like the above.

- Dan

RE: [PATCH]Why do we store svn config section options in a caseinsensitive way?

Posted by Kamesh Jayachandran <ka...@collab.net>.
>+1.  Given the inability to have different rules for differently-cased
>versions of a filename, I don't see why we shouldn't ignore case when
>determining the applicability of an autoprop rule too.
>
>Regards,
>Malcolm


Thanks all. Attaching the patch in the direction suggested by Justin.

With regards
Kamesh Jayachandran




Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Mon, May 21, 2007 at 12:24:29PM -0400, C. Michael Pilato wrote:
> > Silently ignoring config options because the case is wrong seems bad, IMO.
> > 
> > I think it'd be better to normalize filenames before checking the
> > autoprops code.  This would mean that we lose case-sensitivity on the
> > applicability of the autoprops, but I view that as a far lesser evil.
> > -- justin
> 
> Yeah, I think I have to agree.  For one thing, it's easy to document that
> our autoprop application is done case-insensitively.  But secondly, folks
> might actually *prefer* this most of the time, even, especially if their
> repositories are prone to winding up with upper-cased filenames thanks to
> some Windows software.
> 

+1.  Given the inability to have different rules for differently-cased
versions of a filename, I don't see why we shouldn't ignore case when
determining the applicability of an autoprop rule too.

Regards,
Malcolm

Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Justin Erenkrantz wrote:
> On 5/21/07, C. Michael Pilato <cm...@collab.net> wrote:
>> That's true, but to what degree do we care?  We've only ever
>> publicized our
>> option names in lower-case form -- in samples, documentation, and
>> discussion.  So why would somebody choose to use a different form? 
>> Simply
>> because they tried it and nothing fell completely over (for them)? 
>> Shame on
>> them.
> 
> Silently ignoring config options because the case is wrong seems bad, IMO.
> 
> I think it'd be better to normalize filenames before checking the
> autoprops code.  This would mean that we lose case-sensitivity on the
> applicability of the autoprops, but I view that as a far lesser evil.
> -- justin

Yeah, I think I have to agree.  For one thing, it's easy to document that
our autoprop application is done case-insensitively.  But secondly, folks
might actually *prefer* this most of the time, even, especially if their
repositories are prone to winding up with upper-cased filenames thanks to
some Windows software.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 5/21/07, C. Michael Pilato <cm...@collab.net> wrote:
> That's true, but to what degree do we care?  We've only ever publicized our
> option names in lower-case form -- in samples, documentation, and
> discussion.  So why would somebody choose to use a different form?  Simply
> because they tried it and nothing fell completely over (for them)?  Shame on
> them.

Silently ignoring config options because the case is wrong seems bad, IMO.

I think it'd be better to normalize filenames before checking the
autoprops code.  This would mean that we lose case-sensitivity on the
applicability of the autoprops, but I view that as a far lesser evil.
-- justin

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

Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Malcolm Rowe wrote:
> On Mon, May 21, 2007 at 08:36:11PM +0530, Kamesh Jayachandran wrote:
>> SVN config section option names are treated in a case insensitive way. This
>> breaks autoprops setting on a patterns which differs only in case.
>>
> 
> The first statement is true; the second is a corollary of the first.
> Your patch breaks config files that don't use lower case option names,
> doesn't it?

That's true, but to what degree do we care?  We've only ever publicized our
option names in lower-case form -- in samples, documentation, and
discussion.  So why would somebody choose to use a different form?  Simply
because they tried it and nothing fell completely over (for them)?  Shame on
them.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: [PATCH]Why do we store svn config section options in a case insensitive way?

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Mon, May 21, 2007 at 08:36:11PM +0530, Kamesh Jayachandran wrote:
> SVN config section option names are treated in a case insensitive way. This
> breaks autoprops setting on a patterns which differs only in case.
> 

The first statement is true; the second is a corollary of the first.
Your patch breaks config files that don't use lower case option names,
doesn't it?

Regards,
Malcolm