Skip to content

Commit

Permalink
cvsexportcommit: avoid racy CVS problem.
Browse files Browse the repository at this point in the history
If git cvsexportcommit is executed fast enough in sequence, the CVS
timestamps could end up being the same. CVS tries to fix this
by sleeping until the CPU clock changes seconds. Unfortunately,
the CPU clock and the file system clock are not necessarily the same, so
the timestamps could be the same anyway. When that happens CVS may not
recognize changed files and cvs will forget to commit some files.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Robin Rosenberg authored and Junio C Hamano committed Jul 25, 2007
1 parent 1843d8d commit f836f1a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-cvsexportcommit.perl
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@
# clean up
unlink(".cvsexportcommit.diff");

# CVS version 1.11.x and 1.12.x sleeps the wrong way to ensure the timestamp
# used by CVS and the one set by subsequence file modifications are different.
# If they are not different CVS will not detect changes.
sleep(1);

sub usage {
print STDERR <<END;
Usage: GIT_DIR=/path/to/.git ${\basename $0} [-h] [-p] [-v] [-c] [-f] [-m msgprefix] [ parent ] commit
Expand Down

0 comments on commit f836f1a

Please sign in to comment.