Skip to content

Commit f836f1a

Browse files
Robin Rosenberggitster
authored andcommitted
cvsexportcommit: avoid racy CVS problem.
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>
1 parent 1843d8d commit f836f1a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

git-cvsexportcommit.perl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,11 @@
281281
# clean up
282282
unlink(".cvsexportcommit.diff");
283283

284+
# CVS version 1.11.x and 1.12.x sleeps the wrong way to ensure the timestamp
285+
# used by CVS and the one set by subsequence file modifications are different.
286+
# If they are not different CVS will not detect changes.
287+
sleep(1);
288+
284289
sub usage {
285290
print STDERR <<END;
286291
Usage: GIT_DIR=/path/to/.git ${\basename $0} [-h] [-p] [-v] [-c] [-f] [-m msgprefix] [ parent ] commit

0 commit comments

Comments
 (0)