subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <>
Subject Re: svn list support for listing directory entries only
Date Sun, 04 May 2014 11:27:08 GMT
On 04.05.2014 03:13, Dan Ellis wrote:
> Hi,
> 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?

The "depth" parameter is used in many places, not just in "svn list";
whatever enhancement you come up with must at least fit the other uses.
Depth was invented to describe sparse working copies, and was only later
adapted to other commands. For sparse working copies, "depth=dirs"
probably doesn't make much sense.

Once you've defined what "depth=dirs" means for all the commands that
support depth, you're about 10% done ... you'd have to review the
implementation for every use of the depth parameter and either add
"depth=dirs" semantics, or make sure a reasonable error message is
returned if that value is not supported by a particular command:

brane@zulu:~/subversion/trunk$ grep -ir depth subversion | fgrep -v subversion/tests | wc

Good luck with that ... :)

-- Brane

P.S.: That number is a bit inflated, because it counts appearances in
documentation etc., but it's still a substantial code change, and not
trivial in several cases.

Branko ─îibej | Director of Subversion
WANdisco // Non-Stop Data

View raw message