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

Re: Ignore patterns should not be case sensitive (usability)

From: Ryan Schmidt <subversion-2008a_at_ryandesign.com>
Date: Mon, 31 Mar 2008 00:12:22 -0500

On Mar 28, 2008, at 10:40, Erik Huelsmann wrote:

> Absolutely not: the client library knows exactly nothing about the
> client filesystem: it has no knowledge of which APIs to call, it
> doesn't know what the OS uses to encode its paths (in terms of
> character sets) and it doesn't know if the filesystem it's writing to
> is case-sensitive or not. And really, there's no reliable way to know:
> you can't assume on Unix the underlying filesystem is case-sensitive
> (think samba mounts backed by Windows) on a Linux box, nor can you
> assume case-insensitivity on Windows (think a network share backed by
> a Linux box).

First off: to the specific issue at hand, I agree that since
Subversion currently has only case-sensitive ignore patterns, it must
continue to have case-sensitive ignore patterns by default, even if a
case-insensitive option is offered. That's the backwards-
compatibility guarantee which must be maintained.

But just to nitpick the above, though I'm not a C programmer, I would
assume it is in fact possible to determine whether a given directory
lives on a case-sensitive filesystem or not. For example, can't you

1) make a temporary directory with a random name in the directory of
interest (mktemp -d)
2) make a file "foo" in the temporary directory and write a known
string into it
3) see if the file "FOO" now exists in the temporary directory and
contains the known string

If so, the directory is on a case-insensitive filesystem.

Subversion should be made to "play nice" with case-insensitive
filesystems. One issue I know of where Subversion doesn't play nice
is when you have a file "FOO" on disk and you say "svn add foo". On a
case-sensitive filesystem, the shell will say there is no file "foo"
and that's the end of it. But on a case-insensitive filesystem, the
user expects the file FOO to get added, but that's not exactly what
happens. Rather, Subversion sends the contents of the file FOO to the
repository but names it foo, which causes confusion in the working
copy and the filename's case to be recorded incorrectly in the
repository:

$ svnadmin create repo
$ REPO=file://`pwd`/repo
$ svn co $REPO wc
Checked out revision 0.
$ cd wc
$ touch FOO
$ svn add foo
A foo
$ svn ci -m ""
Adding foo
Transmitting file data .
Committed revision 1.
$ svn st
? FOO
! foo
$ ls
FOO
$ svn ls $REPO
foo
$

Sadly this problem has been known for almost six years; see
"Additional comments from William Uther Thu Jun 6 08:45:48 -0700
2002" here:

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

> To clarify: all OS specific code is encapsulated in the APR
> portability layer in order for Subversion code (including its client
> library) to stay platform independent.

If APR doesn't already have a function to determine if a directory is
on a case-sensitive filesystem, that would seem an ideal place to add
it, if it were needed.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-31 07:13:25 CEST

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.