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

'svn diff' vs 'svnlook diff' [was: multiple targets for 'svnlook propget']

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 19 Nov 2012 13:47:40 +0000 (GMT)

Johan Corveleyn wrote:

> Daniel Shahaf wrote:
>> Johan Corveleyn wrote:
>>> I currently have a patch sitting here for adding
>>> --diff-cmd to 'svnlook diff',
>>
>> I wonder what's the minimal change we could make to the cmdline
>> client such that it can operate on transactions (and thus void
>> the need to reimplement every svn proplist/diff/cat/info switch
>> in svnlook). (Read-only, at least initially.)
>>
>> Is this something Julian's tree-read-api branch would address?

Yes my tree-read-api work would make this sort of thing easier.

>> Maybe we need to implement svn_ra_local_txn (like ra_local, but
>> with HEAD being a transaction instead of a revision)?  Other ideas?

Move the
 core tree-diffing functionality down a layer from libsvn_client into
libsvn_diff.  Let 'svn' pass some kinds of 'tree description' inputs to it (from the WC and RA interfaces) and let 'svnlook' pass other kinds of 'tree description' inputs (revisions and txns, from the repos layer).

> I'd like to note that the output of 'svnlook diff' is slightly
> different from 'svn diff', and I'd like to preserve that different
> behavior (or at least preserve the svnlook behavior here). IMO the
> output of 'svnlook diff' is better suited for post-commit emails.

Ugh.  Most of these differences are (IMO) unwanted.  I basically agree with your comments below about which ones are better.

> Some of the differences are (comparing svn 1.7.7 with svnlook 1.5.4):
>
> - 'svnlook diff' shows the differences in the same order as
> 'svnlook changed'.
>
> - 'svnlook diff' shows headers like 'Modified:', 'Added:',
> 'Copied: XXX (from YYY)', 'Deleted:', instead of the boring
> 'Index:' of 'svn diff'.
>
> - they both have the option --no-diff-deleted, but 'svnlook diff'
> then doesn't even show the header of the deleted file, while 'svn
> diff' does. (here I like 'svn diff's behavior better ... I think
> 'svnlook diff' should show the header line 'Deleted:' even with
> --no-diff-deleted (note: my svnlook is version 1.5.4, maybe that's
> already changed ...?)).
>
> - 'svnlook diff' has --diff-copy-from, while 'svn diff' has
> --show-copies-as-adds. Sound like these two are the reverse of each
> other (so maybe the default behavior is reversed). However, I just
> quickly tested an 'svn diff -c XXX' of some revision which has a
> move, and it always shows the moved file in full as a delete and an
> add, no matter if I use --show-copies-as-adds or not. So it seems
> that detecting copies with their sources is broken in 'svn diff'.
>
> - 'svnlook diff' has --no-diff-added, while 'svn diff' doesn't seem
> to have that option. Again, with --no-diff-added, 'svnlook diff'
> doesn't even show the header line, which I don't really like, so
> that can be improved IMO.
>
> - 'svn diff' has --notice-ancestry, but 'svnlook diff' doesn't (and
> I don't know what that option actually does).
>
>
> However, this doesn't mean that both behaviors can't converge, and end
> up with a single implementation. I just want to say that, in my
> opinion, this means porting some of the 'better behavior' from
> 'svnlook diff' to this generic implementation, and not just plainly
> re-using the (in my opinion) inferior behavior of 'svn diff'.

Agreed.

- Julian
Received on 2012-11-19 14:48:18 CET

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.