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

Re: git diff format support

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 24 Aug 2010 22:34:12 +0200

On Tue, Aug 24, 2010 at 05:44:50PM +0100, Jon Foster wrote:
> Hi,
> There is a --git-diff option in Subversion Trunk, so this will
> probably be available in Subversion 1.7.

Yes. But there are some restrictions, most notably with renames.
Our git-style diffs show adds, deletes, and copies properly.
But renames are shown as copy+delete, just like elsewhere in Subversion.
See the example below. We'll need better rename support to improve this.
It's anticipated that at least local renames (i.e. in the working copy)
will be recognized as renames rather than copy+delete in Subversion 1.8.


$ svn cp alpha alpha2
A alpha2
$ svn mv beta beta2
A beta2
D beta
$ svn diff --git-diff --show-copies-as-adds
Index: alpha2
diff --git a/alpha2 b/trunk/alpha
copy from alpha2
copy to trunk/alpha
--- a/alpha2 (revision 0)
+++ b/alpha2 (working copy)
@@ -0,0 +1 @@
Index: beta
diff --git a/beta b/beta
deleted file mode 10644
--- a/beta (revision 2)
+++ /dev/null (working copy)
@@ -1 +0,0 @@
Index: beta2
diff --git a/beta2 b/trunk/beta
copy from beta2
copy to trunk/beta
--- a/beta2 (revision 0)
+++ b/beta2 (working copy)
@@ -0,0 +1 @@
Received on 2010-08-24 22:35:02 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.