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

Re: [proposal] --targets command line option

From: Zack Weinberg <zack_at_codesourcery.com>
Date: 2002-02-28 19:12:44 CET

On Thu, Feb 28, 2002 at 09:02:16AM -0800, David Mankin wrote:
> The difficulty comes up with processing files with spaces in their names.
> Question 1: Do you require each "target" to reside on a different line in
> the file? If not, then you need to worry about quoting file names. E.g.
> Does this file represent one or three targets:
> trunk\My Documents\Word Document.doc
> How about this:
> "trunk\My Documents\Word Document.doc"
> Is that a file whose name ends in " ? Three files, the last of which ends
> in " ? What if you had a file with " in its name? Then you'd need
> backslash escaping ability. But then all the \ would have to be doubled:
> "trunk\\My Documents\\\"The Refrigerator\" Perry - bio.doc"
> Nobody wants that.
> So, it seems, the answer is to keep one, unquoted argment per line.

At least on Unix, there is nothing which prevents a file name from
containing newlines. It is rare for people to do that, but not
unheard of. Nor does the system object to control characters. Any
solution which does not permit all nonzero byte values to appear in
pathname arguments is incomplete.

GNU find/xargs solved this problem with the -print0 action, which
causes all file names to be output separated by ASCII NUL instead of
newline; xargs in turn has a -0 switch to expect this format. The
problem with this approach is, it makes the output/input unsuitable
for human consumption - so you have to have two modes and the user has
to remember to use the right one.

I don't see anything terribly wrong with
        "trunk\\My Documents\\\"The Refrigerator\" Perry - bio.doc"
particularly since *even on Windows* it can be written
        "trunk/My Documents/\"The Refrigerator\" Perry - bio.doc"

Another option is for Subversion to reject any operation which would
create a path name containing dangerous characters. The trouble with
that is, the set of dangerous characters depends on the locale and
character set in use. For instance, under normal conditions ESC is a
dangerous character, but users of various CJK character sets may well
expect to be able to stick ESC in file names (without even being aware
that that's what they're doing).


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:10 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.