You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jeff Lanzarotta <la...@rogersltd.com> on 2004/05/28 14:38:40 UTC

Filename case

Hello,

I have the subversion server (svnserve) setup on a linux machine and our clients run on Windows 2000.

A problem occurred when I was checking out one of our repositories to a new directory. I received the following error: 'Object of the same name already exists.'

What I found out was that I had inadvertently checked in the same file under two different names. The first file name was DELETE.ICO and the second file was delete.ico. DELETE.ICO was checked in under revision 2 and delete.ico was under revision 4. Naturally under Linux, this represents two unique files but under Windows it doesn't.

My question is, is there a way to protect against this? In this scenario, the files DELETE.ICO and delete.ico are actually the same file.

Thoughts and ideas?

Regards,

----
Jeff Lanzarotta

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


Re: Filename case

Posted by Martin Tomes <li...@tomes.org.uk>.
Branko Čibej wrote:
> Martin Tomes wrote:
>>Branko Čibej wrote:
>>>Jeff Lanzarotta wrote:
>>>>Hello,
>>>>
>>>>I have the subversion server (svnserve) setup on a linux machine and
>>>>our clients run on Windows 2000.
>>>>My question is, is there a way to protect against this? In this
>>>>scenario, the files DELETE.ICO and delete.ico are actually the same
>>>>file.
>>>
>>>What exactly would you like to protect against? I see two issues here:
>>>
>>>    * Someone on a case-sensitive system checked in two files that
>>>      differ only in case
>>
>>Not necessarily, if two people on Windows each add a file, one called
>>delete.ico and the other DELETE.ICO and both commit then one can end
>>up in the position described.
> 
> Oh bother. You're right.
>>
>>I have a hook script on our CVS server which prevents this from
>>happening, when the second person tries to commit the new file it is
>>found to already exist with a different case and the commit is
>>rejected.  My next challenge is to write a pre commit hook script
>>which does the same.
> 
> In this case, I think a hook script is exactly the right way to go. Of
> course the fact that it has to support Unicode case folding isn't going
> to help a bit.

I have attached a pre commit hook which looks to see if a file already exists in the repository 
whose name differs only in case.  This is my first stab at this, it does work, but I would 
appreciate comments as to whether it goes about this in the right way.  It does rely on the perl 
lc() function doing the right thing with unicode.  I am afraid that I am no expert in UTF-8 and am 
hoping that the :utf8 stuff on the open commands will do the job.  Perhaps someone with utf-8 file 
paths could try this script.

-- 
Martin Tomes
echo 'Martin x Tomes at controls x eurotherm x co x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'

Re: Filename case

Posted by Martin Tomes <li...@tomes.org.uk>.
Branko Čibej wrote:
> Martin Tomes wrote:
>>Branko Čibej wrote:
>>>Jeff Lanzarotta wrote:
>>>>Hello,
>>>>
>>>>I have the subversion server (svnserve) setup on a linux machine and
>>>>our clients run on Windows 2000.
>>>>My question is, is there a way to protect against this? In this
>>>>scenario, the files DELETE.ICO and delete.ico are actually the same
>>>>file.
>>>
>>>What exactly would you like to protect against? I see two issues here:
>>>
>>>    * Someone on a case-sensitive system checked in two files that
>>>      differ only in case
>>
>>Not necessarily, if two people on Windows each add a file, one called
>>delete.ico and the other DELETE.ICO and both commit then one can end
>>up in the position described.
> 
> Oh bother. You're right.
>>
>>I have a hook script on our CVS server which prevents this from
>>happening, when the second person tries to commit the new file it is
>>found to already exist with a different case and the commit is
>>rejected.  My next challenge is to write a pre commit hook script
>>which does the same.
> 
> In this case, I think a hook script is exactly the right way to go. Of
> course the fact that it has to support Unicode case folding isn't going
> to help a bit.

I have attached a pre commit hook which looks to see if a file already exists in the repository 
whose name differs only in case.  This is my first stab at this, it does work, but I would 
appreciate comments as to whether it goes about this in the right way.  It does rely on the perl 
lc() function doing the right thing with unicode.  I am afraid that I am no expert in UTF-8 and am 
hoping that the :utf8 stuff on the open commands will do the job.  Perhaps someone with utf-8 file 
paths could try this script.

-- 
Martin Tomes
echo 'Martin x Tomes at controls x eurotherm x co x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'

Re: Filename case

Posted by Branko Čibej <br...@xbc.nu>.
Martin Tomes wrote:

> Branko Čibej wrote:
>
>> Jeff Lanzarotta wrote:
>>
>>> Hello,
>>>
>>> I have the subversion server (svnserve) setup on a linux machine and
>>> our clients run on Windows 2000.
>>> My question is, is there a way to protect against this? In this
>>> scenario, the files DELETE.ICO and delete.ico are actually the same
>>> file.
>>
>>
>> What exactly would you like to protect against? I see two issues here:
>>
>>     * Someone on a case-sensitive system checked in two files that
>>       differ only in case
>
>
> Not necessarily, if two people on Windows each add a file, one called
> delete.ico and the other DELETE.ICO and both commit then one can end
> up in the position described.

Oh bother. You're right.

>>       out the tree.
>> As for the second issue, there's really not much to do once the damage
>> is done in the repo (apart from making the error message nicer, of
>> course).
>
>     * This prevented someone on a case-insensitive system from checking
>
> I have a hook script on our CVS server which prevents this from
> happening, when the second person tries to commit the new file it is
> found to already exist with a different case and the commit is
> rejected.  My next challenge is to write a pre commit hook script
> which does the same.

In this case, I think a hook script is exactly the right way to go. Of
course the fact that it has to support Unicode case folding isn't going
to help a bit.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/

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

Re: Filename case

Posted by Martin Tomes <li...@tomes.org.uk>.
Branko Čibej wrote:
> Jeff Lanzarotta wrote:
>>Hello,
>>
>>I have the subversion server (svnserve) setup on a linux machine and our clients run on Windows 2000.
>>My question is, is there a way to protect against this? In this scenario, the files DELETE.ICO and delete.ico are actually the same file.
> 
> What exactly would you like to protect against? I see two issues here:
> 
>     * Someone on a case-sensitive system checked in two files that
>       differ only in case

Not necessarily, if two people on Windows each add a file, one called delete.ico and the other 
DELETE.ICO and both commit then one can end up in the position described.

>     * This prevented someone on a case-insensitive system from checking
>       out the tree.
> As for the second issue, there's really not much to do once the damage
> is done in the repo (apart from making the error message nicer, of course).

I have a hook script on our CVS server which prevents this from happening, when the second person 
tries to commit the new file it is found to already exist with a different case and the commit is 
rejected.  My next challenge is to write a pre commit hook script which does the same.

-- 
Martin Tomes
echo 'Martin x Tomes at controls x eurotherm x co x uk'\
  | sed -e 's/ x /\./g' -e 's/ at /@/'

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


Re: Filename case

Posted by Branko Čibej <br...@xbc.nu>.
Jeff Lanzarotta wrote:

>Hello,
>
>I have the subversion server (svnserve) setup on a linux machine and our clients run on Windows 2000.
>
>A problem occurred when I was checking out one of our repositories to a new directory. I received the following error: 'Object of the same name already exists.'
>
>What I found out was that I had inadvertently checked in the same file under two different names. The first file name was DELETE.ICO and the second file was delete.ico. DELETE.ICO was checked in under revision 2 and delete.ico was under revision 4. Naturally under Linux, this represents two unique files but under Windows it doesn't.
>
>My question is, is there a way to protect against this? In this scenario, the files DELETE.ICO and delete.ico are actually the same file.
>  
>
What exactly would you like to protect against? I see two issues here:

    * Someone on a case-sensitive system checked in two files that
      differ only in case
    * This prevented someone on a case-insensitive system from checking
      out the tree.

There's no real solution for the first issue, unless we introduce the
notion of a "case-insensitive" repository and forced some kind of
case-insensitive behaviour in all working copies. That's a huge change
and won't happen any time soon, if ever.

As for the second issue, there's really not much to do once the damage
is done in the repo (apart from making the error message nicer, of course).

>Thoughts and ideas?
>  
>
You can solve this by removing or renaming one of the two fines directly
in the repository; e.g.,

    svn rm svn://server/path/to/DELETE.ICO

will do the right thing regardless of case-sensitivity on the client.


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/

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