git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-cvsimport-3 and incremental imports

From
John Keeping <john@keeping.me.uk>
Date
Jan 21, 2013, 09:36 UTC
Message-ID
<20130121093658.GD7498@serenity.lan>
In-Reply-To
<20130120232008.GA25001@thyrsus.com>
On Sun, Jan 20, 2013 at 06:20:08PM -0500, Eric S. Raymond wrote:
Show 13 quoted lines
> John Keeping <john@keeping.me.uk>:
>> I don't think there is any way to solve this without giving cvsps more
>> information, probably the last commit time for all git branches, but
>> perhaps I'm missing a fast-import feature that can help solve this
>> problem.
> 
> Yes, you are.  The magic incantation is
> 
>     from refs/heads/<branch>^0
> 
> I've just pushed a cvsps-3.9 with an -i option that generates these at
> each branch root.  Combine it with -d and you get incremental
> fast-export.

I don't think this is enough. I made a very similar change here for testing (conditional on relative_date_start instead of a new flag) and I needed this as well in order to prevent empty duplicate commits being added:

-- >8 --
diff --git a/cvsps.c b/cvsps.c
index fb6a3ad..5771462 100644
--- a/cvsps.c
+++ b/cvsps.c
@@ -1560,7 +1560,7 @@ static bool visible(PatchSet * ps)
  ok:
     //fprintf(stderr, "Time check: %zd %zd %zd\n", restrict_date_start, restrict_date_end, ps->date);
     if (restrict_date_start > 0 &&
-	(ps->date < restrict_date_start ||
+	(ps->date <= restrict_date_start ||
 	 (restrict_date_end > 0 && ps->date > restrict_date_end)))
 	return false;
 
-- 8< --


But this is nothing more than a sticking plaster that happens to do
enough in this particular case - if the Git repository happened to be on
a different branch, the start date would be wrong and too many or too
few commits could be output.  Git doesn't detect that they commits are
identical to some that we already have because we're explicitly telling
it to make a new commit with the specified parent.

You can easily see the breakage by running the tests in the Git tree,
where the CVS revision map tests fail because they end up with duplicate
versions.

You'll need my cvsimport-3 branch to see these failures as it adds the
"git config" support that the tests rely on:

    git://github.com/johnkeeping/git.git cvsimport-3


John
Previous: Junio C HamanoNext: Eric S. Raymond
Message 11 of 16 in “git-cvsimport-3 and incremental imports”
  1. John KeepingJan 20, 2013
  2. Eric S. RaymondJan 20, 2013
  3. Jonathan NiederJan 20, 2013
  4. Junio C HamanoJan 21, 2013
  5. Junio C HamanoJan 21, 2013
  6. Jonathan NiederJan 20, 2013
  7. Eric S. RaymondJan 21, 2013
  8. Jonathan NiederJan 21, 2013
  9. Junio C HamanoJan 21, 2013
  10. Junio C HamanoJan 21, 2013
  11. John KeepingJan 21, 2013
  12. Eric S. RaymondJan 21, 2013
  13. John KeepingJan 21, 2013
  14. Eric S. RaymondJan 21, 2013
  15. John KeepingJan 21, 2013
  16. Eric S. RaymondJan 21, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.