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
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
Try this: "svn ls"
But now "svn ls *.txt" and "svn ls -R *.txt" both do this:
Without understanding svn internals, I would have expexted
"svn ls *.txt"
because a "dir /b *.txt" also gives me
and "svn ls -R *.txt"
dir.txt/ (<-- we can talk about this one...)
as does "dir /s/b *.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:
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.
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Sun Aug 1 10:41:00 2004