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

Re: Do we want 'svn patch' to be able to add empty files?

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 2 Sep 2010 11:27:07 +0300

Daniel Näslund wrote on Thu, Sep 02, 2010 at 07:13:00 +0200:
> On Wed, Sep 01, 2010 at 06:37:08PM +0100, Julian Foad wrote:
> > This may be off topic, but I'm wondering whether Git has defined such
> > operations on directories fully or at all, since it doesn't version them
> > explicitly. I mean, can you tell the difference between "add empty file
> > A" and "add empty dir A"? I could go and look, but haven't time today.
> > If yes, great; if it doesn't, we'll have to invent syntax extensions to
> > do it. (I'm recalling that the goal of this work is we want Subversion
> > diffs to be able to support all valid Subversion changes, and we chose
> > Git format as a basis for supporting that. We don't want to constrain
> > ourselves to only the operations that Git supports.)
>
> Not supported at the moment:
>
> $ svn mkdir X
> A X
> $ svn status
> A X
> $ svn diff
> $ svn diff --git
> $
>
> Suggestion:
>
> $ svn diff --git
> Index: empty
> ===================================================================
> diff --git a/trunk/empty b/trunk/empty
> new directory mode 10644

IIRC trailing slashes on "empty/" were suggested on IRC, what was the
conclusion about that?

>
> E.g., just changing the 'new file mode 10644' line to mention directory
> instead. Haven't investigate what changes would be needed in the diff
> editor.

By the way, are we just influenced by Git's format, or are we looking
for some degree of interoperability? Consider adding a symlink:

[[[
### with git (in $wcroot/trunk/):
diff --git a/trunk/bar b/trunk/bar
new file mode 120000
index 0000000..1910281
--- /dev/null
+++ b/trunk/bar
@@ -0,0 +1 @@
+foo
\ No newline at end of file

### with svn (in $wcroot/trunk/):
Index: bar
===================================================================
diff --git a/trunk/bar b/trunk/bar
new file mode 10644
--- /dev/null (revision 0)
+++ b/trunk/bar (working copy)
@@ -0,0 +1 @@
+link foo
\ No newline at end of file

Property changes on: trunk/bar
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
]]]
Received on 2010-09-02 10:30:42 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.