git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Frech" <david@nimblemachines.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: "Uwe Kleine-König" <ukleinek@informatik.uni-freiburg.de>,
	git@vger.kernel.org
Subject: Re: [PATCH] Support wholesale directory renames in fast-import
Date: Tue, 10 Jul 2007 12:55:46 -0700	[thread overview]
Message-ID: <7154c5c60707101255k7fcd207fg62f1c59518ba5039@mail.gmail.com> (raw)
In-Reply-To: <20070710141442.GM4436@spearce.org>

Hmm. I think Uwe is right. Copy is probably the "right" primitive, and
rename can always be synthesized from copy+delete.

Since Subversion is built around the idea of "cheap copies" there is
no incentive for them to represent renames other than as "copy, then
delete".

But isn't the same true in a way of git? If I copy a directory (a
tree), then the new tree is the same tree - it has the same SHA-1
hash, so I can simply refer to the existing object. Same for file
blobs.

Subversion dump files have *lots* of copies. Might be nice to be able
to feed these directly into fast-import and have it DTRT, esp if it
was smart about sharing identical data structures.

- David

On 7/10/07, Shawn O. Pearce <spearce@spearce.org> wrote:
> Uwe Kleine-K??nig <ukleinek@informatik.uni-freiburg.de> wrote:
> > David Frech wrote:
> > > Now my challenge is that the svn dump doesn't *actually* say "rename
> > > a/ to b/"; it says "copy a/ to b/; delete a/", so I have to infer the
> > > rename.
> >
> > I don't know fast-import very well, but why not doing exactly what the
> > dump file suggests:  copy a b; delete a ?
>
> Because there is no copy operator in fast-import.  So you cannot
> do "copy a b".  Apparently that's what I should have implemented,
> as rename in Git really is as simple as the copy/delete pair.  Ugh.
>
> Copy isn't really that hard, it just can't be nearly as efficient as
> rename, as copying a subtree will force me to either duplicate data
> in memory or reload trees from disk to duplicate data in memory.
> But its a copy, so data duplication is expected.  ;-)
>
> I'll implement a copy opertor soon.  Shouldn't be too difficult.
> Maybe someone else would like to take a shot at implementing it...
>
> --
> Shawn.
>


-- 
If I have not seen farther, it is because I have stood in the
footsteps of giants.

  reply	other threads:[~2007-07-10 19:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10  1:09 how to do directory renames in fast-import David Frech
2007-07-10  3:10 ` [PATCH] Support wholesale " Shawn O. Pearce
2007-07-10  4:16   ` David Frech
2007-07-10 14:03     ` Uwe Kleine-König
2007-07-10 14:14       ` Shawn O. Pearce
2007-07-10 19:55         ` David Frech [this message]
2007-07-11  7:57           ` Shawn O. Pearce
2007-07-11 23:11             ` David Frech
2007-07-10  8:44   ` Rogan Dawes
2007-07-10 13:55     ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7154c5c60707101255k7fcd207fg62f1c59518ba5039@mail.gmail.com \
    --to=david@nimblemachines.com \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    --cc=ukleinek@informatik.uni-freiburg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).