You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Norbert Unterberg <ne...@gmx.net> on 2004/08/01 08:40:06 UTC

Re: Recursive client operations not intuitive

Branko Čibej <brane <at> xbc.nu> writes:

> > In this case they are used to filter 
> >file names within subdirectories, too.
>
> I'd like to see proof of that. I don't believe it.

I have to apologise. 

I have created a small test case and tried to verify all this again. You are 
right, the wildcards are not expanded within subdirectories. However, I find the 
behaviour still some kind of weird, but it is beginning to make sense to me.

This is an example script:

svn mkdir test
cd test
svn mkdir dir.txt
echo test1 > test1.txt
echo test1 > test1.bla
echo test2 > dir.txt\test2.txt
echo test2 > dir.txt\test2.bla
svn add *.*
svn add dir.txt\*.*
svn ci -m "test dir"

This creates a demo directory structure, where "svn ls -R" reports
dir.txt/
dir.txt/test2.bla
dir.txt/test2.txt
test1.bla
test1.txt

Try this: "svn ls"
dir.txt/
test1.bla
test1.txt

But now "svn ls *.txt" and "svn ls -R *.txt" both do this:
test2.bla
test2.txt
test1.txt

Without understanding svn internals, I would have expexted 
"svn ls *.txt"
   dir.txt/
   test1.txt
because a "dir /b *.txt" also gives me 
   dir.txt
   test1.txt

and "svn ls -R *.txt"
   dir.txt/    (<-- we can talk about this one...)
   dir.txt/test2.txt
   test1.txt

as does "dir /s/b *.txt"
   dir.txt
   test1.txt
   dir.txt\test2.txt

Ok lets stop here, I think I am might be starting to count beans ...

I want to go back to the original topic. When I want to perform an operation on 
my project tree, I usally want to perform the operation either on a set of files 
(like removing *.bak in all directories), or on a set of directories (like 
setting the property svn:ignore). Both operations are recursive. I for myself 
dustinguish clearly if the operation is targeting a set of directories or files. 
But I have no way telling svn the target type. svn allows recursive operations 
on single files (not complaining about -R when target is a file), and it 
operates also on files when my intent is to work recursively only on directores. 
svn only distiguishes files from directories in a very implicit way, like not 
setting an svn:ignore property on a file. The only thing the user can do is not 
to name dirctories and files the same way (which is not always possible due to 
rules of some development systems).

To summarize: From my (windows biased) point of view, I think the way svn 
currently handles wildcards and recursion is not optimal. It is your decision if 
this is the correct and planned behaviour, or if this is an issue that might be 
improved. I can live with it now I think I have understood. 

How about some additional sentences in the manual, something like this:

--recursive (-R)
Makes a subcommand recurse into subdirectories, only if the target is a 
directory. Ignored if the target is a file. Care must be taken if the target is 
a wildcard that matches directories and files because the subcommand is applied 
to all matching files and directories individually.
Most subcommands recurse by default.

Norbert



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

Re: Recursive client operations not intuitive

Posted by Roel Harbers <ro...@roelharbers.nl>.
Branko Čibej wrote:

> Of course, any attempt by Subversion to expand wildcards internally 
> would interact with the shell's wildcard expansion, and would cause all 
> sorts of problems with filenames that legitimately contain wildcard 
> characters...

*shiver*

That reminds of the guy here that likes to put all sorts of smileys in 
his (windows) filenames.

Regards,

Roel Harbers


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

Re: Recursive client operations not intuitive

Posted by Branko Čibej <br...@xbc.nu>.
Norbert Unterberg wrote:

>To summarize: From my (windows biased) point of view, I think the way svn 
>currently handles wildcards and recursion is not optimal.
>
I agree, and I don't think this is specific to Windows. At least, any 
use of wildcards with -R is unintuitive; the user expects SVN to expand 
the wildcards in each subdirectory, when in fact it does not.

Of course, any attempt by Subversion to expand wildcards internally 
would interact with the shell's wildcard expansion, and would cause all 
sorts of problems with filenames that legitimately contain wildcard 
characters...


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