git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: "Eric S. Raymond" <esr@thyrsus.com>
Cc: git@vger.kernel.org
Subject: Re: git-cvsimport-3 and incremental imports
Date: Mon, 21 Jan 2013 09:36:58 +0000	[thread overview]
Message-ID: <20130121093658.GD7498@serenity.lan> (raw)
In-Reply-To: <20130120232008.GA25001@thyrsus.com>

On Sun, Jan 20, 2013 at 06:20:08PM -0500, Eric S. Raymond wrote:
> 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

  parent reply	other threads:[~2013-01-21  9:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 20:09 git-cvsimport-3 and incremental imports John Keeping
2013-01-20 23:20 ` Eric S. Raymond
2013-01-20 23:34   ` Jonathan Nieder
2013-01-21  0:01     ` Junio C Hamano
2013-01-21  0:06       ` Junio C Hamano
2013-01-20 23:42   ` Jonathan Nieder
2013-01-21  1:06     ` Eric S. Raymond
2013-01-21  6:42       ` Jonathan Nieder
2013-01-21  7:28       ` Junio C Hamano
2013-01-21  7:35         ` Junio C Hamano
2013-01-21  9:36   ` John Keeping [this message]
2013-01-21 11:28     ` Eric S. Raymond
2013-01-21 12:00       ` John Keeping
2013-01-21 12:43         ` Eric S. Raymond
2013-01-21 13:27           ` John Keeping
2013-01-21 14:07             ` Eric S. Raymond

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130121093658.GD7498@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=esr@thyrsus.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).