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

Re: script or tool to walk back thru 1 file's history diffing..

From: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 9 Sep 2011 11:40:24 +0200

On Fri, Sep 09, 2011 at 09:44:06AM +0200, Johan Corveleyn wrote:
> On Fri, Sep 9, 2011 at 2:06 AM, <subversion_at_trodman.com> wrote:
> > Would like to write a script to follow the history of a single
> > file, backwards, diffing the file w/it's prior version all the way
> > back to the 1st version.
> >
> > By using 'svn info' to get the last chgd rev, and running 'svn
> > diff -c $lastchgd_rev ...', this seems simple enough if the URL to
> > the file does not change; but if the pathname in svn to the file
> > is renamed there is no choice but to look at 'svn log', right?
> >
> > --
> > thanks/regards,
> > Tom
> >
> > --
> > Does such a command line tool already exist?
>
> Well, yes, such a command line tool already exists :-). At least, it
> does in 1.7.0 RC2:
>
> 'svn log --diff' will produce the log with the diffs inline.
>
> Take a look at one of the 1.7.0 pre-release binaries available here:
> http://subversion.apache.org/packages.html#pre-release

If you use log --diff in some automated process, be aware that some diff
options (among them --show-copies-as-adds and --no-diff-deleted) are
hard-coded and cannot be changed.

There is (at least) one diff bug which can cause surprises.
An automated process consuming log --diff output should be aware of it.
If you ask for the diff of one newly added file, you can end up getting
a diff for an entire subtree, or even the entire tree in the repository
at the given revision.
See http://subversion.tigris.org/issues/show_bug.cgi?id=2873#desc7

The intended use case for log --diff is code review by a human.
Received on 2011-09-09 11:41:34 CEST

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

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