[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: Stefan Sperling <stsp_at_elego.de>
Date: Thu, 2 Sep 2010 13:57:49 +0200

On Thu, Sep 02, 2010 at 11:27:07AM +0300, Daniel Shahaf wrote:
> 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.)

This is a known problem. Git has no way of representing directories
to the best of my knowledge (haven't checked the code...)
I guess we'll need to make up our own way of representing them.

Right now, svn patch will always add an empty file if something is added
that only has props. But the patch might want to create a directory instead.
Is there a 1:1 mapping svn: propery -> node kind (file or dir)?
If so, we could get away with just checking the type of property when
deciding whether to create a file or a directory.

Filed as http://subversion.tigris.org/issues/show_bug.cgi?id=3698

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

I don't like this, because it's way too subtle. And it's not clear how other
tools like git and hg would handle this.

I'd prefer adding a new git-diff-style header that says "this is a directory,
not a file". If possible, in a way that git and hg would ignore.
 
Stefan
Received on 2010-09-02 13:58:36 CEST

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