public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce•org>
To: Julian Phillips <julian@quantumfyre•co.uk>
Cc: git@vger•kernel.org
Subject: Re: Another question about importing SVN with fast-import
Date: Mon, 16 Jul 2007 23:38:40 -0400	[thread overview]
Message-ID: <20070717033840.GK32566@spearce.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0707162204480.14971@reaper.quantumfyre.co.uk>

Julian Phillips <julian@quantumfyre•co.uk> wrote:
> First off, I would just like to say fast-import rocks.  It's well named 
> too ...

I'm glad you like it.  ;-)
 
> Now the question.  Shawn recently added C and R operations - almost as 
> soon as they were asked for too.

Sometimes I'm responsive...

> However, how do you copy a file from a 
> particular revision?

and sometimes not so much.  You can't do that right now.  I've wanted
to open up the data subcommand to allow another form that lets you
specify data from a branch and file path (thus selecting a blob
from another revision) but I haven't gotten around to it.  I also
don't have time to do it during the earlier part of this week.
Maybe I'll get to it later near the end of the week.

It shouldn't be too difficult now with the tree_content_get()
function that I recently defined for the C/R commands.  The SHA-1
comes back in the tree_entry leaf, but that codepath is only valid
for the tip of a branch that fast-import knows about in memory.
If it doesn't then you probably need to fallback into raw tree
parsing.  Ugh.

The way prior frontends have handled this is they assigned marks
to every blob, and then had a translation table within the frontend
of revision->mark, so that anytime it needed a given revision of a
file it knew what mark to send to fast-import.  This does require
that the frontend maintain basically everything...

> I have just hit a point where someone deleted a 
> directory, and then copied one of the files from that directory back from 
> an old revision (as two separate commits).  Since I'm not tracking any 
> branch contents in my front-end, and the copy operation only works from 
> the current branch head I seem to be stuck ... or have I missed something?

Yea, I got nothing.  I can't think of any method to make that work
aside from using marks.  Or teaching fast-import how to do tree
lookup, like I described above.

-- 
Shawn.

  reply	other threads:[~2007-07-17  3:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16 21:11 Another question about importing SVN with fast-import Julian Phillips
2007-07-17  3:38 ` Shawn O. Pearce [this message]
2007-08-06 13:13   ` Julian Phillips
2007-08-07  1:08     ` Shawn O. Pearce
2007-07-19  7:09 ` David Frech
2007-07-20  5:11   ` Shawn O. Pearce
2007-07-20  5:50     ` Julian Phillips
2007-07-20  6:54       ` David Frech
2007-07-20  7:01         ` Julian Phillips
2007-07-20  7:16           ` David Frech
2007-07-23 18:06     ` Jan Hudec

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=20070717033840.GK32566@spearce.org \
    --to=spearce@spearce$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    --cc=julian@quantumfyre$(echo .)co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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