You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2000/11/02 00:21:36 UTC

Re: cmd line stuff (was: CVS update: ...)

On Thu, Oct 26, 2000 at 03:45:43PM -0400, Greg Hudson wrote:
> > I depend on the contents of ./CVS/Root.  ``svn diff -r foo -r bar
> > `cat SVN/Root`/path/to/file'' is much worse than ``cvs rdiff -r foo
> > -r bar path/to/file'' :-) Perhaps I am misunderstanding?
> 
> "rdiff" is most often used when you don't have a working directory.
> 
> After thinking about this a big more, here is my opinion:
> 
> 	* It's probably bad namespace mixing to use the same argument
> 	  slot for either "working directory file" or "repository
> 	  object".  So a command-line flag to say "operate on the
> 	  repository instead of the working directory" is probably
> 	  better than just slipping in a URL.

A local file "will never" start with http://, so we can easily differentiate
between references to the working dir and to the repository itself.

Shouldn't be a problem at all..

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: cmd line stuff (was: CVS update: ...)

Posted by Jim Blandy <ji...@zwingli.cygnus.com>.
> > If someone thinks they might
> > use files named http://, they should have to go through hoops to make
> > it work.  (I do think we should provide those hoops.  That's what the
> > `script' prefix was about.)
> 
> Well, remember: you can't create a file with "/" in it. On Windows, you
> can't create files with ":" in them.

Yes.  But http://foo is equivalent to http:/foo.

No, humans don't name their files that way.  They don't use double
slashes.  And if they did, they'd most likely notice when they typed
the command, "Hey, that looks like a URL.  Hmm."  No debate there.

But when you have scripts constructing filenames and building paths,
all bets are off.  The filenames may be built from unpredictable
sources, and who knows whether Joe Perl took the time to write the
script carefully.  In that case, I think it's nice to offer a more
directly controlled interface, where the contents of the string never
affect its interpretation.  Then you can write "${name}" in your
Bourne shell script, and not worry that things will fall apart if
$name has unsavory contents.

Some people don't think it's worth worrying about all this.  Maybe
they're right.  But it pisses me off no end how hard it is to write
Bourne shell scripts that handle filenames with spaces in it, or that
start with dashes, etc.  It's just stupid.  And I don't want to create
tools that contribute to the problem.

Re: cmd line stuff (was: CVS update: ...)

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Nov 02, 2000 at 12:06:59AM -0500, Jim Blandy wrote:
> Greg Stein <gs...@lyra.org> writes:
>...
> > A local file "will never" start with http://, so we can easily differentiate
> > between references to the working dir and to the repository itself.
> > 
> > Shouldn't be a problem at all..
> 
> I think URL's are more graceful, too.

Excellent way to characterize it. Yes... definitely more graceful compared
to using a URL plus a requirement for a cmd-line switch just to tell the
client what is blatantly obvious from a simple inspection of the "file".

> If someone thinks they might
> use files named http://, they should have to go through hoops to make
> it work.  (I do think we should provide those hoops.  That's what the
> `script' prefix was about.)

Well, remember: you can't create a file with "/" in it. On Windows, you
can't create files with ":" in them.

[ the Mac throws all this for a loop: it is rather difficult because the use
  of "/" and ":" probably depends upon the particular filesystem you're
  working against. ]

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: cmd line stuff (was: CVS update: ...)

Posted by Jim Blandy <ji...@savonarola.red-bean.com>.
Greg Stein <gs...@lyra.org> writes:

> On Thu, Oct 26, 2000 at 03:45:43PM -0400, Greg Hudson wrote:
> > > I depend on the contents of ./CVS/Root.  ``svn diff -r foo -r bar
> > > `cat SVN/Root`/path/to/file'' is much worse than ``cvs rdiff -r foo
> > > -r bar path/to/file'' :-) Perhaps I am misunderstanding?
> > 
> > "rdiff" is most often used when you don't have a working directory.
> > 
> > After thinking about this a big more, here is my opinion:
> > 
> > 	* It's probably bad namespace mixing to use the same argument
> > 	  slot for either "working directory file" or "repository
> > 	  object".  So a command-line flag to say "operate on the
> > 	  repository instead of the working directory" is probably
> > 	  better than just slipping in a URL.
> 
> A local file "will never" start with http://, so we can easily differentiate
> between references to the working dir and to the repository itself.
> 
> Shouldn't be a problem at all..

I think URL's are more graceful, too.  If someone thinks they might
use files named http://, they should have to go through hoops to make
it work.  (I do think we should provide those hoops.  That's what the
`script' prefix was about.)