git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git fast-import file format question
@ 2009-07-07 19:06 Troy Telford
  2009-07-07 19:10 ` Shawn O. Pearce
  0 siblings, 1 reply; 2+ messages in thread
From: Troy Telford @ 2009-07-07 19:06 UTC (permalink / raw)
  To: git

I've been writing an importer for a one-off version control system, so
I can import from that version control into git.

So far, I'm pretty pleased with the results, but I'm running into
problems with incremental updates.  I have to be able to continually
pull updates (as the one-off system is still in use), so being able to
grab only the "new" commits is important.

My importer is able to grab just the "new" commit information, and
write it to a file that 'git fast-import' can read.  However, I'm
running into the following problem:

warning: Not updating refs/heads/foo (new tip
aae6a85831127a2b5bef957af81f2b127d98ee6c does not contain
486cb1a4f683da43a72932b3e40c3999bcf3728b)stout6

Which I took to mean that as my commit didn't have the previous
commit, it was failing.  So I modified my importer so that it would
include the "last" known commit (to git), and then had everything new.
 I received the same error (with different SHA1s, as I recall...)

When I was looking at the man page for git-fast-import (and looking at
the output of git-fast-export for a valid git repo), I noted the
"from" directive.  There's a clip there that tells me that "Omitting
the from command on existing branches is usually desired, as the
current commit on that branch is automatically assumed to be the first
ancestor of the new commit."

I double-checked, and the first commit in the files I'm generating
(for incremental updates, at least) does not have the 'from'
directive.

So what do I need to do in order to get git to attach the incremental
update I have to the existing repository?

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

* Re: Git fast-import file format question
  2009-07-07 19:06 Git fast-import file format question Troy Telford
@ 2009-07-07 19:10 ` Shawn O. Pearce
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn O. Pearce @ 2009-07-07 19:10 UTC (permalink / raw)
  To: Troy Telford; +Cc: git

Troy Telford <ttelford.groups@gmail.com> wrote:
> When I was looking at the man page for git-fast-import (and looking at
> the output of git-fast-export for a valid git repo), I noted the
> "from" directive.  There's a clip there that tells me that "Omitting
> the from command on existing branches is usually desired, as the
> current commit on that branch is automatically assumed to be the first
> ancestor of the new commit."

That section meant "existing branches within this import session".

To restart an import, you need to use the from command in the
first commit of that session, e.g. to restart an import on
refs/heads/master use:

  from refs/heads/master^0

-- 
Shawn.

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

end of thread, other threads:[~2009-07-07 19:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07 19:06 Git fast-import file format question Troy Telford
2009-07-07 19:10 ` Shawn O. Pearce

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