{"thread":{"id":"20051","subject":"Git fast-import file format question","startedAt":"2009-07-07T19:06:08Z","lastAt":"2009-07-07T19:10:55Z","messageCount":2,"participants":["Troy Telford","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"117574","messageId":"1e30a6d10907071206u21ecd9d8wb53441a3bf7b64c4@mail.gmail.com","threadId":"20051","inReplyTo":null,"subject":"Git fast-import file format question","fromName":"Troy Telford","fromEmail":"ttelford.groups@gmail.com","sentAt":"2009-07-07T19:06:08Z","receivedAt":"2009-07-07T19:06:08Z","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 for a one-off version control system, so\nI can import from that version control into git.\n\nSo far, I'm pretty pleased with the results, but I'm running into\nproblems with incremental updates.  I have to be able to continually\npull updates (as the one-off system is still in use), so being able to\ngrab only the \"new\" commits is important.\n\nMy importer is able to grab just the \"new\" commit information, and\nwrite it to a file that 'git fast-import' can read.  However, I'm\nrunning into the following problem:\n\nwarning: Not updating refs/heads/foo (new tip\naae6a85831127a2b5bef957af81f2b127d98ee6c does not contain\n486cb1a4f683da43a72932b3e40c3999bcf3728b)stout6\n\nWhich I took to mean that as my commit didn't have the previous\ncommit, it was failing.  So I modified my importer so that it would\ninclude the \"last\" known commit (to git), and then had everything new.\n I received the same error (with different SHA1s, as I recall...)\n\nWhen I was looking at the man page for git-fast-import (and looking at\nthe output of git-fast-export for a valid git repo), I noted the\n\"from\" directive.  There's a clip there that tells me that \"Omitting\nthe from command on existing branches is usually desired, as the\ncurrent commit on that branch is automatically assumed to be the first\nancestor of the new commit.\"\n\nI double-checked, and the first commit in the files I'm generating\n(for incremental updates, at least) does not have the 'from'\ndirective.\n\nSo what do I need to do in order to get git to attach the incremental\nupdate I have to the existing repository?\n"},{"id":"117575","messageId":"20090707191055.GA11191@spearce.org","threadId":"20051","inReplyTo":"1e30a6d10907071206u21ecd9d8wb53441a3bf7b64c4@mail.gmail.com","subject":"Re: Git fast-import file format question","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-07-07T19:10:55Z","receivedAt":"2009-07-07T19:10: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> When I was looking at the man page for git-fast-import (and looking at\n> the output of git-fast-export for a valid git repo), I noted the\n> \"from\" directive.  There's a clip there that tells me that \"Omitting\n> the from command on existing branches is usually desired, as the\n> current commit on that branch is automatically assumed to be the first\n> ancestor of the new commit.\"\n\nThat section meant \"existing branches within this import session\".\n\nTo restart an import, you need to use the from command in the\nfirst commit of that session, e.g. to restart an import on\nrefs/heads/master use:\n\n  from refs/heads/master^0\n\n-- \nShawn.\n"}]}