git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-fast-import question
@ 2009-07-29 22:36 Troy Telford
  2009-07-29 22:48 ` Shawn O. Pearce
  0 siblings, 1 reply; 3+ messages in thread
From: Troy Telford @ 2009-07-29 22:36 UTC (permalink / raw)
  To: git

I've been writing an importer from an older SCM into git.  I'm getting
the following behavior with using git-fast-import:

The file I'm importing has something along the lines of:

commit refs/heads/foo
<various metadata>
M 100644 :mark path/to/some/file

Then, later on, there's another commit:

commit refs/heads/foo
<various metadata>
R path/to/some/file new/path/to/some/file

As far as I've been able to see, the :from tag points to the correct
commit (which is also in the correct branch).  There are no instances
of 'reset <branch>' being called anywhere.  The file isn't deleted
anywhere.

But when I run fast-import, I receive an error to the extent of:
fatal:  Path path/to/some/file not in branch

So to me, it looks like the file that I'm renaming should exist in the
branch - it's not being renamed anywhere, not being deleted, and the
branch isn't reset.  Yet fast-import doesn't seem to think the file
exists.

I'm using git 1.6.3.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git-fast-import question
  2009-07-29 22:36 git-fast-import question Troy Telford
@ 2009-07-29 22:48 ` Shawn O. Pearce
  2009-07-30  0:00   ` Troy Telford
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn O. Pearce @ 2009-07-29 22:48 UTC (permalink / raw)
  To: Troy Telford; +Cc: git

Troy Telford <ttelford.groups@gmail.com> wrote:
> But when I run fast-import, I receive an error to the extent of:
> fatal:  Path path/to/some/file not in branch
> 
> So to me, it looks like the file that I'm renaming should exist in the
> branch - it's not being renamed anywhere, not being deleted, and the
> branch isn't reset.  Yet fast-import doesn't seem to think the file
> exists.

Perhaps try inserting a checkpoint just before the rename commit,
so you can actually look at the tree structure in the output branch
when the crash occurs.  My initial guess is, you don't have what
you think you have.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git-fast-import question
  2009-07-29 22:48 ` Shawn O. Pearce
@ 2009-07-30  0:00   ` Troy Telford
  0 siblings, 0 replies; 3+ messages in thread
From: Troy Telford @ 2009-07-30  0:00 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git

> My initial guess is, you don't have what
> you think you have.

Thanks for the tip - you're right in that I don't have what I think I have.

Namely, there are entire sections of the dump file that aren't getting
imported.  fast-import isn't complaining about it either.

commit refs/heads/foo
<various metadata>
M 100644 :mark path/to/some/file

Isn't getting imported (to any branch, let alone refs/heads/foo)

So when the later commit wants to rename the file, it can't be found.

Digging a bit deeper, I found a few cases where I'd have something
along the lines of:

commit refs/heads/foo
mark :1
<etc, etc.>

commit refs/heads/foo
mark :2
from :1
<etc, etc>

ie. two sequential commits, to the same branch.  The first commit is
being imported; the second commit isn't being imported.  Many
subsequent commits are similarly cast aside - then for no reason I can
tell, commits start getting imported again.  I'd expect fast-import to
complain, but that doesn't seem to be happening.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-30  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29 22:36 git-fast-import question Troy Telford
2009-07-29 22:48 ` Shawn O. Pearce
2009-07-30  0:00   ` Troy Telford

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).