git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: Heiko Voigt <git-list@hvoigt.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	ydirson@altern.org, git@vger.kernel.org
Subject: Re: [CVSPS PATCH] fix: correct rev order in case commiters clocks were not syncronised
Date: Mon, 09 Mar 2009 16:02:12 +0100	[thread overview]
Message-ID: <49B52F74.1090006@alum.mit.edu> (raw)
In-Reply-To: <49B4FCDA.4030106@hvoigt.net>

Heiko Voigt wrote:
> This fixes the following kind of cvsps issues:
> 
>  Structure of the test cvs repository
> 
>  Message   File:Content         Commit Time
>  Rev 1     a: 1.1               2009-02-21 19:11:43 +0100
>  Rev 2     a: 1.2    b: 1.1     2009-02-21 19:11:14 +0100
>  Rev 3               b: 1.2     2009-02-21 19:11:43 +0100
> 
>  As you can see the commit of Rev 3 has the same time as
>  Rev 1 this was leading to a broken estimation of patchset
>  order.
> 
> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>

I am not familiar with the cvsps code, so I will just make some comments
about things that it is not obvious from your patch that you have
considered.  These things all caused problems in pre-2.0 versions of
cvs2svn:

1. It is not clear from the patch in what order the revisions are being
processed.  If they are being processed in the order that they appear in
the RCS file, then you have to consider branches:

   * The date adjustment should only occur along chains of revisions
that are "causally related" -- that is, adjacent revisions on trunk, or
adjacent revisions on a branch, or the first revision on a branch
relative to the revision from which the branch sprouted.  It is not
always the case that revisions that are adjacent in the RCS file are
causally related.

   * The revisions along trunk appear in RCS files in reverse
chronological order; e.g., 1.3, 1.2, 1.1 (this seems to be the case you
handle).  But the revisions along a branch appear in chronological
order; e.g., 1.3.2.1, 1.3.2.2, 1.3.2.3.  Do you handle both cases
correctly?  (A unit test involving revisions on branches would be helpful.)

2. One form of clock skew that is common in CVS repositories is that
some computer's CMOS battery went dead and the clock reverted to 1970
after every reboot.  Given that you adjust revisions' times only towards
the past, then such a glitch would force the times of all earlier
revisions to be pushed back to 1970.  (Since you unconditionally
subtract one second from each commit timestamp, this could also
conceivably cause an underflow to 2038, but this is admittedly rather
unlikely.)  This is a hard problem to solve generally.  But if you want
to handle this problem more robustly, I suggest that you always adjust
times towards the future, as incorrect clock times in the far future
seem to be less common in practice.

Of course these clock skew corrections, if only applied to one file at a
time, can easily cause changesets to be broken up if the time deltas
exceed five minutes.

3. When cvsps collects individual file revisions into changesets (within
the 5 minute window), a single "consensus" commit time has to be chosen
from all of the single-file commits.  Depending on how cvsps does this,
it could be that the consensus commit times for two commits involving
revisions within a single file are put back out of order (undoing your
timestamp fixup).  It would be nice to verify that this does not result
in out-of-order commits.

Michael

  reply	other threads:[~2009-03-09 15:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-23 18:49 [PATCH] cvsimport: add test illustrating a bug in cvsps Heiko Voigt
2009-02-23 20:35 ` Heiko Voigt
2009-02-24  5:00 ` Michael Haggerty
2009-03-02 17:59   ` [PATCH v2 0/1] " Heiko Voigt
2009-03-02 17:59   ` [PATCH v2 1/1] " Heiko Voigt
2009-03-09 11:26     ` [CVSPS PATCH] fix: correct rev order in case commiters clocks were not syncronised Heiko Voigt
2009-03-09 15:02       ` Michael Haggerty [this message]
2009-03-18 17:33         ` [PATCH v3 0/2] cvsimport: add test illustrating a bug in cvsps Heiko Voigt
2009-03-18 18:22           ` Junio C Hamano
2009-03-19 10:41             ` Michael J Gruber
2009-03-19 11:00               ` Johannes Schindelin
2009-03-19 11:22                 ` Michael J Gruber
2009-03-21  5:41               ` Michael Haggerty
2009-03-23 18:11                 ` started a cvsps testsuite Was: " Heiko Voigt
2009-03-23 19:06                   ` Martin Langhoff
2009-03-24  4:50                   ` Michael Haggerty
2009-04-06 19:01                     ` Heiko Voigt
2009-03-23 17:47             ` Heiko Voigt
2009-03-18 17:33         ` [PATCH v3 1/2] " Heiko Voigt
2009-03-18 17:33         ` [PATCH v3 2/2] cvsimport: extend testcase about patchset order to contain branches Heiko Voigt
2009-03-18 17:34         ` [CVSPS PATCH v2] fix: correct rev order in case commiters clocks were not syncronised Heiko Voigt

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=49B52F74.1090006@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=git-list@hvoigt.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ydirson@altern.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).