[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Provide a svn log -v with the option to filter out changeset's

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Fri, 23 Aug 2013 11:47:54 +0100 (BST)

Ben Reser wrote:

> On Wed Aug 21 10:44:52 2013, Patrick Sawyer wrote:
>> It could be useful to have a svn -v option that would give the option
>> to filter out the changeset to only reflect the changes with respect
>> to the file/subdir you run the command on.
>>
>> Users performing a log may not care about the rest of the changeset.
>
> I'm assuming you mean svn log -v.
>
> I've wanted some sort of --exclude option to log so that I can ignore
> changes that only touch things in the exclude list (would make my job
> of writing CHANGES for the branches easier).  But that doesn't seem to
> be what you're proposing here.
>
> You just want the verbose listing of modifications to be trimmed to
> only the path you asked for.

That's how I understand Patrick's request, and I wholeheartedly agree there's a need for that functionality.

> We allow the output of the diff when
> --diff is used to be limited with --depth, so I suppose that --depth
> could be allowed without --diff and could limit the -v output as well.
>
> Anyone else have some thoughts on this?

Before considering --depth, first let me talk about just the paths.

The changed-paths list shown by "svn log TARGET -v" has always listed the changes for the whole commit, rather than just within the TARGET.  The newish "svn log TARGET --diff" output, on the other hand, shows only a diff of TARGET.  These two are inconsistent with each other, and it would be good to do something about it.

But it is more complex than that.  There is not always just one target, there is also the option to specify multiple subtrees when the main target is a URL:

  $ svn log --help
  log: Show the log messages for a set of revision(s) and/or path(s).
  usage: 1. log [PATH][@REV]
         2. log URL[@REV] [PATH...]
  [...]
  2. Print the log messages for the PATHs (default: '.') under URL.

The semantics implemented by 'svn log' is to show only the revisions where at least one of the subtrees was touched, but the '--diff' output still shows a diff of the whole of TARGET, irrespective of any specified subtrees.

What to do?  My suggestion would be to add options to control the output more explicitly, something like this:

  svn log TARGET [SUBTREE...]
    --diff            // diff of TARGET [SUBTREE...]
    --diff-all        // diff of whole commit
    --show-paths      // changed-paths for TARGET [SUBTREE...]
    --show-all-paths  // changed-paths for whole commit; alias -v
    -v/--verbose      // alias for '--show-all-paths'

This meaning of '--diff' is the same as today when subtrees are not specified, different from today when subtrees are specified.  (I'd argue this is a desirable change.)  And this meaning of '-v' is unchanged.

=== Depth ===

The --depth option currently is only allowed with --diff and only affects the diff.

It would be useful to be able to run a log that shows only the revisions that affect the immediate children of the path ^/branches, for example, to find branch creations and deletions.  This is not currently possible.  Thus, I think it makes sense to implement --depth for the main log filtering, not just for the diff.

I would suggest:

  svn log TARGET [SUBTREE...] --depth=D
    // report each rev that affects a path within any subtree to depth D
    --diff            // diff of each subtree, each to depth D
    --diff-all        // diff of whole commit
    --show-paths      // changed-paths of each subtree, each to depth D
    --show-all-paths  // changed-paths of whole commit
    -v/--verbose      // alias for '--show-all-paths'

Thoughts?

- Julian
Received on 2013-08-23 12:48:55 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.