{"thread":{"id":"20286","subject":"git-fast-import question","startedAt":"2009-07-29T22:36:33Z","lastAt":"2009-07-30T00:00:02Z","messageCount":3,"participants":["Troy Telford","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"119110","messageId":"1e30a6d10907291536y3ec68caq8788aef2b7c34a6f@mail.gmail.com","threadId":"20286","inReplyTo":null,"subject":"git-fast-import question","fromName":"Troy Telford","fromEmail":"ttelford.groups@gmail.com","sentAt":"2009-07-29T22:36:33Z","receivedAt":"2009-07-29T22:36:33Z","isPatch":false,"sender":{"key":"ttelford.groups@gmail.com","avatar":"https://gravatar.com/avatar/7fb1a08052bfe7645125d4c1bcd6d8f58b780239c783f9064f341831d9456049?d=mp&s=160"},"body":"I've been writing an importer from an older SCM into git.  I'm getting\nthe following behavior with using git-fast-import:\n\nThe file I'm importing has something along the lines of:\n\ncommit refs/heads/foo\n<various metadata>\nM 100644 :mark path/to/some/file\n\nThen, later on, there's another commit:\n\ncommit refs/heads/foo\n<various metadata>\nR path/to/some/file new/path/to/some/file\n\nAs far as I've been able to see, the :from tag points to the correct\ncommit (which is also in the correct branch).  There are no instances\nof 'reset <branch>' being called anywhere.  The file isn't deleted\nanywhere.\n\nBut when I run fast-import, I receive an error to the extent of:\nfatal:  Path path/to/some/file not in branch\n\nSo to me, it looks like the file that I'm renaming should exist in the\nbranch - it's not being renamed anywhere, not being deleted, and the\nbranch isn't reset.  Yet fast-import doesn't seem to think the file\nexists.\n\nI'm using git 1.6.3.3\n"},{"id":"119113","messageId":"20090729224855.GD1033@spearce.org","threadId":"20286","inReplyTo":"1e30a6d10907291536y3ec68caq8788aef2b7c34a6f@mail.gmail.com","subject":"Re: git-fast-import question","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-07-29T22:48:55Z","receivedAt":"2009-07-29T22:48:55Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Troy Telford <ttelford.groups@gmail.com> wrote:\n> But when I run fast-import, I receive an error to the extent of:\n> fatal:  Path path/to/some/file not in branch\n> \n> So to me, it looks like the file that I'm renaming should exist in the\n> branch - it's not being renamed anywhere, not being deleted, and the\n> branch isn't reset.  Yet fast-import doesn't seem to think the file\n> exists.\n\nPerhaps try inserting a checkpoint just before the rename commit,\nso you can actually look at the tree structure in the output branch\nwhen the crash occurs.  My initial guess is, you don't have what\nyou think you have.\n\n-- \nShawn.\n"},{"id":"119122","messageId":"1e30a6d10907291700u55eef62cy22c87815602616ee@mail.gmail.com","threadId":"20286","inReplyTo":"20090729224855.GD1033@spearce.org","subject":"Re: git-fast-import question","fromName":"Troy Telford","fromEmail":"ttelford.groups@gmail.com","sentAt":"2009-07-30T00:00:02Z","receivedAt":"2009-07-30T00:00:02Z","isPatch":false,"sender":{"key":"ttelford.groups@gmail.com","avatar":"https://gravatar.com/avatar/7fb1a08052bfe7645125d4c1bcd6d8f58b780239c783f9064f341831d9456049?d=mp&s=160"},"body":"> My initial guess is, you don't have what\n> you think you have.\n\nThanks for the tip - you're right in that I don't have what I think I have.\n\nNamely, there are entire sections of the dump file that aren't getting\nimported.  fast-import isn't complaining about it either.\n\ncommit refs/heads/foo\n<various metadata>\nM 100644 :mark path/to/some/file\n\nIsn't getting imported (to any branch, let alone refs/heads/foo)\n\nSo when the later commit wants to rename the file, it can't be found.\n\nDigging a bit deeper, I found a few cases where I'd have something\nalong the lines of:\n\ncommit refs/heads/foo\nmark :1\n<etc, etc.>\n\ncommit refs/heads/foo\nmark :2\nfrom :1\n<etc, etc>\n\nie. two sequential commits, to the same branch.  The first commit is\nbeing imported; the second commit isn't being imported.  Many\nsubsequent commits are similarly cast aside - then for no reason I can\ntell, commits start getting imported again.  I'd expect fast-import to\ncomplain, but that doesn't seem to be happening.\n"}]}