subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Schmidt <subversion-2...@ryandesign.com>
Subject Re: svn list support for listing directory entries only
Date Sun, 04 May 2014 02:16:39 GMT

On May 3, 2014, at 20:13, Dan Ellis wrote:

> The svn command line list command currently accepts --depth arguments of files, infinity,
and immediates (and empty, but that is really a no-op).  I'm in need of being able to list
directory entries only in a repository, but I'm not sure there is any good way to accomplish
that as-is.  I've search the lists and can only find articles about how folks have grep'ed
the output or hacked list.c to only return directory entries (which is really just an inelegant
grep anyways since the server still will be sending the data).
> 
> Is there a way, or consideration from the developers to add a feature, to fetch only
directory entries from a repo?  Perhaps a --depth dirs (opposite of --depth files) option.
 If there is no off the shelf way and/or the developers are against (or don't see enough need)
to implement this, would there be any advise on how to accomplish this with a patch?  Is there
in inherent limitation to the server protocol that makes a request like this simply unworkable?


Directories are printed with a trailing slash, so if you just want directories, you could
grep for that:

$ svn ls http://svn.apache.org/repos/asf/subversion/trunk/
.ycm_extra_conf.py
BUGS
CHANGES
COMMITTERS
INSTALL
LICENSE
Makefile.in
NOTICE
README
aclocal.m4
autogen.sh
build/
build.conf
configure.ac
contrib/
doc/
gen-make.py
get-deps.sh
notes/
subversion/
tools/
win-tests.py
$ svn ls http://svn.apache.org/repos/asf/subversion/trunk/ | grep /$
build/
contrib/
doc/
notes/
subversion/
tools/
$ 

Alternately you could use the --xml argument to svn, then parse the xml it gives you.

You already mentioned the grep solution in your message, so I’m guessing that’s not satisfactory
for some reason. If that’s true, then maybe you could explain in more detail what you need
exactly, if it’s not the above.



Mime
View raw message