{"thread":{"id":"9152","subject":"Test #7 in t9200-git-cvsexportcommit fails","startedAt":"2007-07-22T19:41:53Z","lastAt":"2007-07-25T07:43:31Z","messageCount":21,"participants":["Jason Sewall","Alex Riesen","Junio C Hamano","Simon 'corecode' Schubert","Robin Rosenberg","Linus Torvalds","Andy Parkins","Marius Storm-Olsen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"48178","messageId":"31e9dd080707221241j5c00aaaaqa79c12d3e2a3345b@mail.gmail.com","threadId":"9152","inReplyTo":null,"subject":"Test #7 in t9200-git-cvsexportcommit fails","fromName":"Jason Sewall","fromEmail":"jasonsewall@gmail.com","sentAt":"2007-07-22T19:41:53Z","receivedAt":"2007-07-22T19:41:53Z","isPatch":false,"sender":{"key":"jasonsewall@gmail.com","avatar":null},"body":"This test fails for me on the current head (pulled just now) and where\nthe test was introduced (e86ad71fe).\n\nAll other tests pass.\n\nI know almost nothing about how CVS works internally, so I don't have\nany insight as to the cause of this problem - all I can see is that\nthe contents of CVS/Entries has the 'with spaces' files at 1.1 instead\nof the expect 1.2.\n\nI'm happy to provide more information if you can tell me how to get\nit. In particular, I'd like to tell you about my version of perl-cvs\n(or whatever it's called) but I have no idea how to do that...\n\nJason\n\nP.S. I don't use this part of git at all, so this is not a priority\nfor me. I am using Fedora 7, which is definitely a mainstream distro,\nso I imagine others might have this problem too.\n"},{"id":"48185","messageId":"20070722202121.GA3288@steel.home","threadId":"9152","inReplyTo":"31e9dd080707221241j5c00aaaaqa79c12d3e2a3345b@mail.gmail.com","subject":"Re: Test #7 in t9200-git-cvsexportcommit fails","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-22T20:21:21Z","receivedAt":"2007-07-22T20:21:21Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Jason Sewall, Sun, Jul 22, 2007 21:41:53 +0200:\n> This test fails for me on the current head (pulled just now) and where\n> the test was introduced (e86ad71fe).\n\nAahh, the test where CVS failed to commit sub-second changes...\nIt never really succeeded.\n\n> P.S. I don't use this part of git at all, so this is not a priority\n> for me. I am using Fedora 7, which is definitely a mainstream distro,\n> so I imagine others might have this problem too.\n\nJust disable it:\n\n    $ echo \"export GIT_SKIP_TESTS = t9200\" >>config.mak\n\nIt'll never work, cvs does not commit changes made during one second,\nas they have the same timestamp.\n\nIf you feel interested, try investigating the test by running it with\n\"-d -v\", like this:\n\n    $ cd t\n    $ ./t9200-git-cvsexportcommit.sh -d -v -i\n\nYou'll have to run it multiple times, probably: the problem is\nsometimes timing dependent and changed output conditions may make it\ngo away for a while. Just continue trying.\n"},{"id":"48188","messageId":"31e9dd080707221349g40ff050bue72733f270822603@mail.gmail.com","threadId":"9152","inReplyTo":"20070722202121.GA3288@steel.home","subject":"Re: Test #7 in t9200-git-cvsexportcommit fails","fromName":"Jason Sewall","fromEmail":"jasonsewall@gmail.com","sentAt":"2007-07-22T20:49:19Z","receivedAt":"2007-07-22T20:49:19Z","isPatch":false,"sender":{"key":"jasonsewall@gmail.com","avatar":null},"body":"> It'll never work, cvs does not commit changes made during one second,\n> as they have the same timestamp.\n\nWhy not add a delay in there, like this:\n\nid=$(git rev-list --max-count=1 HEAD) && sleep 2\n\nIt makes the test work for me.\n\nJason\n"},{"id":"48199","messageId":"20070722214224.GA2732@steel.home","threadId":"9152","inReplyTo":"31e9dd080707221349g40ff050bue72733f270822603@mail.gmail.com","subject":"Re: Test #7 in t9200-git-cvsexportcommit fails","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-22T21:42:24Z","receivedAt":"2007-07-22T21:42:24Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Jason Sewall, Sun, Jul 22, 2007 22:49:19 +0200:\n> >It'll never work, cvs does not commit changes made during one second,\n> >as they have the same timestamp.\n> \n> Why not add a delay in there, like this:\n> \n> id=$(git rev-list --max-count=1 HEAD) && sleep 2\n> \n> It makes the test work for me.\n\nIt looks just like another reason to disable it. It is not like the\n_git_ functionality which is used by git-cvsexportcommit is not\nalready tested elsewhere.\n\nNote that I do _NOT_ suggest disabling it by default, but a bit of\nwarning would probably do some good:\n\ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex 4efa0c9..e5e9e36 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -6,6 +6,12 @@ test_description='CVS export comit. '\n \n . ./test-lib.sh\n \n+echo >&2\n+echo >&2 \"This test is very timing dependent and may fail.\"\n+echo >&2 \"If you don't need git-cvsexportcommit you're better off\"\n+echo >&2 \"disabling it: make test GIT_SKIP_TESTS=t9200\"\n+echo >&2\n+\n cvs >/dev/null 2>&1\n if test $? -ne 1\n then\n"},{"id":"48220","messageId":"7vk5ssqdy0.fsf@assigned-by-dhcp.cox.net","threadId":"9152","inReplyTo":"31e9dd080707221349g40ff050bue72733f270822603@mail.gmail.com","subject":"Re: Test #7 in t9200-git-cvsexportcommit fails","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-22T22:19:19Z","receivedAt":"2007-07-22T22:19:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jason Sewall\" <jasonsewall@gmail.com> writes:\n\n>> It'll never work, cvs does not commit changes made during one second,\n>> as they have the same timestamp.\n\nHeh, racy CVS?\n\n> Why not add a delay in there, like this:\n>\n> id=$(git rev-list --max-count=1 HEAD) && sleep 2\n>\n> It makes the test work for me.\n\nSounds like an acceptable workaround.  Care to send in a tested\nsigned patch?\n"},{"id":"48257","messageId":"11851631511468-git-send-email-jasonsewall@gmail.com","threadId":"9152","inReplyTo":"7vk5ssqdy0.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Jason Sewall","fromEmail":"jasonsewall@gmail.com","sentAt":"2007-07-23T03:59:11Z","receivedAt":"2007-07-23T03:59:11Z","isPatch":true,"sender":{"key":"jasonsewall@gmail.com","avatar":null},"body":"Test #7 of t9200 isn't likely to succeed because tests are executed too fast for cvs; add a delay to give it a chance to succeed.\n---\n I think I didn't send this through the proper server, so here it is finally.\n t/t9200-git-cvsexportcommit.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex 4efa0c9..2096e59 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -164,6 +164,7 @@ test_expect_success \\\n       git add \"G g/with spaces.png\" &&\n       git commit -a -m \"Update with spaces\" &&\n       id=$(git rev-list --max-count=1 HEAD) &&\n+      sleep 1 &&\n       (cd \"$CVSWORK\" &&\n       git-cvsexportcommit -c $id\n       test \"$(echo $(sort \"G g/CVS/Entries\"|cut -d/ -f2,3,5))\" = \"with spaces.png/1.2/-kb with spaces.txt/1.2/\"\n--\n1.5.3.rc2.4.g726f9\n"},{"id":"48260","messageId":"7vd4yjoi2w.fsf@assigned-by-dhcp.cox.net","threadId":"9152","inReplyTo":"11851631511468-git-send-email-jasonsewall@gmail.com","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-23T04:32:55Z","receivedAt":"2007-07-23T04:32:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jason Sewall <jasonsewall@gmail.com> writes:\n\n> Test #7 of t9200 isn't likely to succeed because tests are executed too fast for cvs; add a delay to give it a chance to succeed.\n> ---\n>  I think I didn't send this through the proper server, so here it is finally.\n>  t/t9200-git-cvsexportcommit.sh |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\n> index 4efa0c9..2096e59 100755\n> --- a/t/t9200-git-cvsexportcommit.sh\n> +++ b/t/t9200-git-cvsexportcommit.sh\n> @@ -164,6 +164,7 @@ test_expect_success \\\n>        git add \"G g/with spaces.png\" &&\n>        git commit -a -m \"Update with spaces\" &&\n>        id=$(git rev-list --max-count=1 HEAD) &&\n> +      sleep 1 &&\n>        (cd \"$CVSWORK\" &&\n>        git-cvsexportcommit -c $id\n>        test \"$(echo $(sort \"G g/CVS/Entries\"|cut -d/ -f2,3,5))\" = \"with spaces.png/1.2/-kb with spaces.txt/1.2/\"\n\nThanks.\n\nBut this makes one wonder why only this test and nothing else is\naffected.  Maybe our machines are not fast enough for other\ntests to execute inside a second, but in 6 months others start\nto become problem and we would need a similar fix again?\n\nI am tempted to do this instead, although it would make it much\nslower.\n\nIt may be that we may want to fix this inside cvsexportcommit\nitself, instead of working it around in the tests.  If somebody\ntries to push more than one commit from git using two\ncvsexportcommit in a row, he would need to make sure that the\nsecond run happens one or more seconds after the first run,\notherwise he will see the exact corruption in real life.\n\nAnybody else have better ideas?  \n\n---\n t/t9200-git-cvsexportcommit.sh |   29 ++++++++++++++++++-----------\n 1 files changed, 18 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex 4efa0c9..28c7dfa 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -28,6 +28,13 @@ git add empty &&\n git commit -q -a -m \"Initial\" 2>/dev/null ||\n exit 1\n \n+git_cvsexportcommit () {\n+\t# CVS does not even look at files whose timestamps\n+\t# match the ones recorded in CVS/Entries\n+\tsleep 2 &&\n+\tgit cvsexportcommit \"$@\"\n+}\n+\n test_expect_success \\\n     'New file' \\\n     'mkdir A B C D E F &&\n@@ -42,7 +49,7 @@ test_expect_success \\\n      git commit -a -m \"Test: New file\" &&\n      id=$(git rev-list --max-count=1 HEAD) &&\n      (cd \"$CVSWORK\" &&\n-     git cvsexportcommit -c $id &&\n+     git_cvsexportcommit -c $id &&\n      test \"$(echo $(sort A/CVS/Entries|cut -d/ -f2,3,5))\" = \"newfile1.txt/1.1/\" &&\n      test \"$(echo $(sort B/CVS/Entries|cut -d/ -f2,3,5))\" = \"newfile2.txt/1.1/\" &&\n      test \"$(echo $(sort C/CVS/Entries|cut -d/ -f2,3,5))\" = \"newfile3.png/1.1/-kb\" &&\n@@ -66,7 +73,7 @@ test_expect_success \\\n      git commit -a -m \"Test: Remove, add and update\" &&\n      id=$(git rev-list --max-count=1 HEAD) &&\n      (cd \"$CVSWORK\" &&\n-     git cvsexportcommit -c $id &&\n+     git_cvsexportcommit -c $id &&\n      test \"$(echo $(sort A/CVS/Entries|cut -d/ -f2,3,5))\" = \"newfile1.txt/1.2/\" &&\n      test \"$(echo $(sort B/CVS/Entries|cut -d/ -f2,3,5))\" = \"\" &&\n      test \"$(echo $(sort C/CVS/Entries|cut -d/ -f2,3,5))\" = \"\" &&\n@@ -88,7 +95,7 @@ test_expect_success \\\n      git commit -a -m \"generation 2\" &&\n      id=$(git rev-list --max-count=1 HEAD) &&\n      (cd \"$CVSWORK\" &&\n-     ! git cvsexportcommit -c $id\n+     ! git_cvsexportcommit -c $id\n      )'\n \n #test_expect_success \\\n@@ -100,7 +107,7 @@ test_expect_success \\\n #     git commit -a -m \"generation 3\" &&\n #     id=$(git rev-list --max-count=1 HEAD) &&\n #     (cd \"$CVSWORK\" &&\n-#     ! git cvsexportcommit -c $id\n+#     ! git_cvsexportcommit -c $id\n #     )'\n \n # We reuse the state from two tests back here\n@@ -114,7 +121,7 @@ test_expect_success \\\n      git commit -a -m \"test: remove only a binary file\" &&\n      id=$(git rev-list --max-count=1 HEAD) &&\n      (cd \"$CVSWORK\" &&\n-     git cvsexportcommit -c $id &&\n+     git_cvsexportcommit -c $id &&\n      test \"$(echo $(sort A/CVS/Entries|cut -d/ -f2,3,5))\" = \"newfile1.txt/1.2/\" &&\n      test \"$(echo $(sort B/CVS/Entries|cut -d/ -f2,3,5))\" = \"\" &&\n      test \"$(echo $(sort C/CVS/Entries|cut -d/ -f2,3,5))\" = \"\" &&\n@@ -132,7 +139,7 @@ test_expect_success \\\n      git commit -a -m \"test: remove only a binary file\" &&\n      id=$(git rev-list --max-count=1 HEAD) &&\n      (cd \"$CVSWORK\" &&\n-     git cvsexportcommit -c $id &&\n+     git_cvsexportcommit -c $id &&\n      test \"$(echo $(sort A/CVS/Entries|cut -d/ -f2,3,5))\" = \"\" &&\n      test \"$(echo $(sort B/CVS/Entries|cut -d/ -f2,3,5))\" = \"\" &&\n      test \"$(echo $(sort C/CVS/Entries|cut -d/ -f2,3,5))\" = \"\" &&\n@@ -153,7 +160,7 @@ test_expect_success \\\n       git commit -a -m \"With spaces\" &&\n       id=$(git rev-list --max-count=1 HEAD) &&\n       (cd \"$CVSWORK\" &&\n-      git-cvsexportcommit -c $id &&\n+      git_cvsexportcommit -c $id &&\n       test \"$(echo $(sort \"G g/CVS/Entries\"|cut -d/ -f2,3,5))\" = \"with spaces.png/1.1/-kb with spaces.txt/1.1/\"\n       )'\n \n@@ -165,7 +172,7 @@ test_expect_success \\\n       git commit -a -m \"Update with spaces\" &&\n       id=$(git rev-list --max-count=1 HEAD) &&\n       (cd \"$CVSWORK\" &&\n-      git-cvsexportcommit -c $id\n+      git_cvsexportcommit -c $id\n       test \"$(echo $(sort \"G g/CVS/Entries\"|cut -d/ -f2,3,5))\" = \"with spaces.png/1.2/-kb with spaces.txt/1.2/\"\n       )'\n \n@@ -190,7 +197,7 @@ test_expect_success \\\n       git commit -a -m \"Går det så går det\" && \\\n       id=$(git rev-list --max-count=1 HEAD) &&\n       (cd \"$CVSWORK\" &&\n-      git-cvsexportcommit -v -c $id &&\n+      git_cvsexportcommit -v -c $id &&\n       test \"$(echo $(sort Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/CVS/Entries|cut -d/ -f2,3,5))\" = \"gårdetsågårdet.png/1.1/-kb gårdetsågårdet.txt/1.1/\"\n       )'\n \n@@ -208,7 +215,7 @@ test_expect_success \\\n       git commit -a -m \"Update two\" &&\n       id=$(git rev-list --max-count=1 HEAD) &&\n       (cd \"$CVSWORK\" &&\n-      ! git-cvsexportcommit -c $id\n+      ! git_cvsexportcommit -c $id\n       )'\n \n case \"$(git repo-config --bool core.filemode)\" in\n@@ -225,7 +232,7 @@ test_expect_success \\\n       git add G/off &&\n       git commit -a -m \"Execute test\" &&\n       (cd \"$CVSWORK\" &&\n-      git-cvsexportcommit -c HEAD\n+      git_cvsexportcommit -c HEAD\n       test -x G/on &&\n       ! test -x G/off\n       )'\n"},{"id":"48280","messageId":"46A45EF4.9090305@fs.ei.tum.de","threadId":"9152","inReplyTo":"7vd4yjoi2w.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Simon 'corecode' Schubert","fromEmail":"corecode@fs.ei.tum.de","sentAt":"2007-07-23T07:55:32Z","receivedAt":"2007-07-23T07:55:32Z","isPatch":true,"sender":{"key":"corecode@fs.ei.tum.de","avatar":"https://gravatar.com/avatar/eff9dbf0cdac0d1e6a6cd7ed0e50763edcb376b493b5253a35ff167918ad79e1?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> It may be that we may want to fix this inside cvsexportcommit\n> itself, instead of working it around in the tests.  If somebody\n> tries to push more than one commit from git using two\n> cvsexportcommit in a row, he would need to make sure that the\n> second run happens one or more seconds after the first run,\n> otherwise he will see the exact corruption in real life.\n\nAh, now I see the problem.  The timestamp in the CVS/Entries is the same (because it only has second granularity), so cvs commit won't consider it as changed.\n\nThat's the reason why CVS usually waits until the second turns after a \"update\" (obviously not after a \"commit\").  So we could either turn back the timestamp in the Entries file (ugly) or simply wait until the second turns.  Given the overall cvs performance, this won't be a big issue, I guess.\n\ncheers\n  simon\n\n-- \nServe - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /\"\\\nWork - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \\ /\nParty Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \\\nDude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \\\n"},{"id":"48386","messageId":"200707240223.54228.robin.rosenberg.lists@dewire.com","threadId":"9152","inReplyTo":"46A45EF4.9090305@fs.ei.tum.de","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-07-24T00:23:53Z","receivedAt":"2007-07-24T00:23:53Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"måndag 23 juli 2007 skrev Simon 'corecode' Schubert:\n> Junio C Hamano wrote:\n> > It may be that we may want to fix this inside cvsexportcommit\n> > itself, instead of working it around in the tests.  If somebody\n> > tries to push more than one commit from git using two\n> > cvsexportcommit in a row, he would need to make sure that the\n> > second run happens one or more seconds after the first run,\n> > otherwise he will see the exact corruption in real life.\n> \n> Ah, now I see the problem.  The timestamp in the CVS/Entries is the same (because it only has second granularity), \n> so cvs commit won't consider it as changed. \n> \n> That's the reason why CVS usually waits until the second turns after a \"update\" (obviously not after a \"commit\"). \n> So we could either turn back the timestamp in the Entries file (ugly) or simply wait until the second turns.  Given \n> the overall cvs performance, this won't be a big issue, I guess. \n> \n> cheers\n>   simon\n> \n\nCVS sleeps after commit here. Can we bisect it? I have 1.12.3 (mandriva). The patch below I think\nwould work around the problem, rather than trying to fix the test. but I'd like to have the last CVS \nrevision where it does not work for the patch comment \n\nSince the sleep is per invocation of cvsexportcommit it won't hurt too much since it is rarely invoked\non a huge number of git commits.\n\n-- robin\n\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex d6ae99b..6377408 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -277,6 +277,10 @@ if ($opt_c) {\n # clean up\n unlink(\".cvsexportcommit.diff\");\n\n+# timestamp problems. Invoking this command on a machine that is too fast may result in\n+# CVS not recognizing changed because the timestamp is unchanged\n+sleep(1);\n+\n sub usage {\n        print STDERR <<END;\n Usage: GIT_DIR=/path/to/.git ${\\basename $0} [-h] [-p] [-v] [-c] [-f] [-m msgprefix] [ parent ] commit\n"},{"id":"48404","messageId":"46A5B43E.3030700@fs.ei.tum.de","threadId":"9152","inReplyTo":"200707240223.54228.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Simon 'corecode' Schubert","fromEmail":"corecode@fs.ei.tum.de","sentAt":"2007-07-24T08:11:42Z","receivedAt":"2007-07-24T08:11:42Z","isPatch":true,"sender":{"key":"corecode@fs.ei.tum.de","avatar":"https://gravatar.com/avatar/eff9dbf0cdac0d1e6a6cd7ed0e50763edcb376b493b5253a35ff167918ad79e1?d=mp&s=160"},"body":"Robin Rosenberg wrote:\n>>> It may be that we may want to fix this inside cvsexportcommit\n>>> itself, instead of working it around in the tests.  If somebody\n>>> tries to push more than one commit from git using two\n>>> cvsexportcommit in a row, he would need to make sure that the\n>>> second run happens one or more seconds after the first run,\n>>> otherwise he will see the exact corruption in real life.\n>> Ah, now I see the problem.  The timestamp in the CVS/Entries is the same (because it only has second granularity), \n>> so cvs commit won't consider it as changed. \n>>\n>> That's the reason why CVS usually waits until the second turns after a \"update\" (obviously not after a \"commit\"). \n>> So we could either turn back the timestamp in the Entries file (ugly) or simply wait until the second turns.  Given \n>> the overall cvs performance, this won't be a big issue, I guess. \n> \n> CVS sleeps after commit here. Can we bisect it? I have 1.12.3\n> (mandriva). The patch below I think would work around the problem,\n> rather than trying to fix the test. but I'd like to have the last CVS\n>  revision where it does not work for the patch comment\n\nThis is a strange thing.  CVS has this in their commit code since 1996.  So I wonder why this is getting triggered.\n\n> Since the sleep is per invocation of cvsexportcommit it won't hurt\n> too much since it is rarely invoked on a huge number of git commits.\n\nThe question also is, why does this happen on two sequential invocations of cvsexportcommit, but not on two cvs commits done by cvsexportcommit?  This should look the same to cvs, no?\n\ncheers\n  simon\n\n-- \nServe - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /\"\\\nWork - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \\ /\nParty Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \\\nDude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \\\n"},{"id":"48406","messageId":"200707241033.36509.robin.rosenberg.lists@dewire.com","threadId":"9152","inReplyTo":"46A5B43E.3030700@fs.ei.tum.de","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-07-24T08:33:35Z","receivedAt":"2007-07-24T08:33:35Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdag 24 juli 2007 skrev Simon 'corecode' Schubert:\n> Robin Rosenberg wrote:\n> >>> It may be that we may want to fix this inside cvsexportcommit\n> >>> itself, instead of working it around in the tests.  If somebody\n> >>> tries to push more than one commit from git using two\n> >>> cvsexportcommit in a row, he would need to make sure that the\n> >>> second run happens one or more seconds after the first run,\n> >>> otherwise he will see the exact corruption in real life.\n> >> Ah, now I see the problem.  The timestamp in the CVS/Entries is the same (because it only has second granularity), \n> >> so cvs commit won't consider it as changed. \n> >>\n> >> That's the reason why CVS usually waits until the second turns after a \"update\" (obviously not after a \"commit\"). \n> >> So we could either turn back the timestamp in the Entries file (ugly) or simply wait until the second turns.  Given \n> >> the overall cvs performance, this won't be a big issue, I guess. \n> > \n> > CVS sleeps after commit here. Can we bisect it? I have 1.12.3\n> > (mandriva). The patch below I think would work around the problem,\n> > rather than trying to fix the test. but I'd like to have the last CVS\n> >  revision where it does not work for the patch comment\n> \n> This is a strange thing.  CVS has this in their commit code since 1996.  So I wonder why this is getting triggered.\n> \n> > Since the sleep is per invocation of cvsexportcommit it won't hurt\n> > too much since it is rarely invoked on a huge number of git commits.\n> \n> The question also is, why does this happen on two sequential invocations of cvsexportcommit, but not on two cvs commits done by cvsexportcommit?  This should look the same to cvs, no?\n\nI reread my post here...  My last sentence was a comment to the patch and not the sleep in CVS.\n\n-- robin\n"},{"id":"48407","messageId":"46A5BA87.50105@fs.ei.tum.de","threadId":"9152","inReplyTo":"200707241033.36509.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Simon 'corecode' Schubert","fromEmail":"corecode@fs.ei.tum.de","sentAt":"2007-07-24T08:38:31Z","receivedAt":"2007-07-24T08:38:31Z","isPatch":true,"sender":{"key":"corecode@fs.ei.tum.de","avatar":"https://gravatar.com/avatar/eff9dbf0cdac0d1e6a6cd7ed0e50763edcb376b493b5253a35ff167918ad79e1?d=mp&s=160"},"body":"Robin Rosenberg wrote:\n>>> Since the sleep is per invocation of cvsexportcommit it won't hurt\n>>> too much since it is rarely invoked on a huge number of git commits.\n>> The question also is, why does this happen on two sequential invocations of cvsexportcommit, but not on two cvs commits done by cvsexportcommit?  This should look the same to cvs, no?\n> \n> I reread my post here... My last sentence was a comment to the patch\n> and not the sleep in CVS.\n\nYes, I realize this.  Still, I wonder the same:  why is this needed *per invocation of cvsexportcommit* and not *per invocation of cvs*?  Seems unintuitive to me, or I didn't read the patch good enough.\n\ncheers\n  simon\n\n-- \nServe - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /\"\\\nWork - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \\ /\nParty Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \\\nDude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \\\n"},{"id":"48419","messageId":"200707241134.31950.robin.rosenberg.lists@dewire.com","threadId":"9152","inReplyTo":"46A5BA87.50105@fs.ei.tum.de","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-07-24T09:34:30Z","receivedAt":"2007-07-24T09:34:30Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdag 24 juli 2007 skrev Simon 'corecode' Schubert:\n> Robin Rosenberg wrote:\n> >>> Since the sleep is per invocation of cvsexportcommit it won't hurt\n> >>> too much since it is rarely invoked on a huge number of git commits.\n> >> The question also is, why does this happen on two sequential invocations \n> >> of cvsexportcommit, but not on two cvs commits done by cvsexportcommit?  \n> >> This should look the same to cvs, no?  \n> > \n> > I reread my post here... My last sentence was a comment to the patch\n> > and not the sleep in CVS.\n> \n> Yes, I realize this.  Still, I wonder the same:  why is this needed *per\n> invocation of cvsexportcommit* and not *per invocation of cvs*?  Seems\n> unintuitive to me, or I didn't read the patch good enough.  \n\nBesides the potential update and status commands cvs is only invoked once per\ninvocation of cvsexportcommit so there is no difference between a sleep per CVS\ninvokation vs a sleep per cvsexportcommit invocation. The sleep is needed to make\nsure file modification times resulting from git-apply are different. \n\nThe sleep in CVS fixes that on my machine so I do not have a problem (and cannot \nreally verify that the patch I made fixes the problem).\n\nThis debug patch reveals the sleep in CVS. CVS does the sleep differently for different platforms.\n\ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex 4efa0c9..9a1e998 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -153,7 +153,7 @@ test_expect_success \\\n       git commit -a -m \"With spaces\" &&\n       id=$(git rev-list --max-count=1 HEAD) &&\n       (cd \"$CVSWORK\" &&\n-      git-cvsexportcommit -c $id &&\n+      strace -fF -o a git-cvsexportcommit -c $id &&\n       test \"$(echo $(sort \"G g/CVS/Entries\"|cut -d/ -f2,3,5))\" = \"with spaces.png/1.1/-kb with spaces.txt/1.1/\"\n       )'\n \n@@ -165,7 +165,7 @@ test_expect_success \\\n       git commit -a -m \"Update with spaces\" &&\n       id=$(git rev-list --max-count=1 HEAD) &&\n       (cd \"$CVSWORK\" &&\n-      git-cvsexportcommit -c $id\n+      strace -fF -o b git-cvsexportcommit -c $id\n       test \"$(echo $(sort \"G g/CVS/Entries\"|cut -d/ -f2,3,5))\" = \"with spaces.png/1.2/-kb with spaces.txt/1.2/\"\n       )'\n\nTail of the first cvsexportcommit invocation (trash/cvswork/a) from the place where it writes the last file\ninto the CVS repo.\n \n27778 write(7, \"/with spaces.png/1.1/Tue Jul 24 \"..., 99) = 99\n27778 close(7)                          = 0\n27778 munmap(0xb7f15000, 4096)          = 0\n27778 rename(\"CVS/Entries.Backup\", \"CVS/Entries\") = 0\n27778 unlink(\"CVS/Entries.Log\")         = 0\n27778 fchdir(6)                         = 0\n27778 close(6)                          = 0\n27778 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0\n27778 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0\n27778 time(NULL)                        = 1185268822\n27778 gettimeofday({1185268822, 953340}, NULL) = 0\n\nHere CVS sleeps. The amount varies between invocations since it\nonly sleeps enough for the seconds to wrap.\n\n27778 nanosleep({0, 46660000}, NULL)    = 0\n27778 time(NULL)                        = 1185268823\n27778 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0\n27778 close(1 <unfinished ...>\n27766 <... read resumed> \"\", 4096)      = 0\n27778 <... close resumed> )             = 0\n27766 close(6 <unfinished ...>\n27778 munmap(0xb7f14000, 4096 <unfinished ...>\n27766 <... close resumed> )             = 0\n27778 <... munmap resumed> )            = 0\n\nBack into git-cvsexportcommit\n27766 rt_sigaction(SIGHUP, {SIG_IGN},  <unfinished ...>\n27778 exit_group(0)                     = ?\n27766 <... rt_sigaction resumed> {SIG_DFL}, 8) = 0\n27766 --- SIGCHLD (Child exited) @ 0 (0) ---\n27766 rt_sigaction(SIGINT, {SIG_IGN}, {SIG_DFL}, 8) = 0\n27766 rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}, 8) = 0\n27766 waitpid(27778, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 27778\n27766 rt_sigaction(SIGHUP, {SIG_DFL}, NULL, 8) = 0\n27766 rt_sigaction(SIGINT, {SIG_DFL}, NULL, 8) = 0\n27766 rt_sigaction(SIGQUIT, {SIG_DFL}, NULL, 8) = 0\n27766 unlink(\".msg\")                    = 0\n27766 unlink(\".cvsexportcommit.diff\")   = 0\n27766 stat64(\"/home/me/tmp/git-cvsapplycommit-55ADfh\", {st_mode=S_IFDIR|0700, st_size=6, ...}) = 0\n27766 lstat64(\"/home/me/tmp/git-cvsapplycommit-55ADfh\", {st_mode=S_IFDIR|0700, st_size=6, ...}) = 0\n27766 chmod(\"/home/me/tmp/git-cvsapplycommit-55ADfh\", 0700) = 0\n27766 open(\"/home/me/tmp/git-cvsapplycommit-55ADfh\", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 6\n27766 fstat64(6, {st_mode=S_IFDIR|0700, st_size=6, ...}) = 0\n27766 fcntl64(6, F_SETFD, FD_CLOEXEC)   = 0\n27766 getdents64(6, /* 2 entries */, 4096) = 48\n27766 getdents64(6, /* 0 entries */, 4096) = 0\n27766 close(6)                          = 0\n27766 rmdir(\"/home/me/tmp/git-cvsapplycommit-55ADfh\") = 0\n27766 write(1, \"/home/me/SW/GIT/t/trash/cvsroot/\"..., 234) = 234\n27766 exit_group(0)                     = ?\n\n-- robin\n"},{"id":"48425","messageId":"7v8x96glca.fsf@assigned-by-dhcp.cox.net","threadId":"9152","inReplyTo":"200707241134.31950.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-24T10:14:13Z","receivedAt":"2007-07-24T10:14:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n\n> Tail of the first cvsexportcommit invocation (trash/cvswork/a) from the place where it writes the last file\n> into the CVS repo.\n>  \n> 27778 write(7, \"/with spaces.png/1.1/Tue Jul 24 \"..., 99) = 99\n> 27778 close(7)                          = 0\n> 27778 munmap(0xb7f15000, 4096)          = 0\n> 27778 rename(\"CVS/Entries.Backup\", \"CVS/Entries\") = 0\n> 27778 unlink(\"CVS/Entries.Log\")         = 0\n> 27778 fchdir(6)                         = 0\n> 27778 close(6)                          = 0\n> ...\n> 27778 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0\n> 27778 time(NULL)                        = 1185268822\n> 27778 gettimeofday({1185268822, 953340}, NULL) = 0\n>\n> Here CVS sleeps. The amount varies between invocations since it\n> only sleeps enough for the seconds to wrap.\n\nMakes one wonder what it would do if you are on a filesystem\nwith coarser-than-a-second timestamp resolution.\n"},{"id":"48454","messageId":"200707241457.53414.robin.rosenberg.lists@dewire.com","threadId":"9152","inReplyTo":"7v8x96glca.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-07-24T12:57:51Z","receivedAt":"2007-07-24T12:57:51Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdag 24 juli 2007 skrev Junio C Hamano:\n> > Here CVS sleeps. The amount varies between invocations since it\n> > only sleeps enough for the seconds to wrap.\n> \n> Makes one wonder what it would do if you are on a filesystem\n> with coarser-than-a-second timestamp resolution.\n\nLike fat, but then the last test fails on FAT, which wasn't the case. Any other reasonable file\nsystems that comes to your mind?\n\nJason, could you provide us with some more information on OS, fs, cvs version etc.\n\nWhether timestamp granularity is larger than a second or not can be checked with this line, I think:\n\n\ttouch a && ls --full-time a && sleep 1 && touch a && ls --full-time a\n\nSample output where the timestamps are roughly one second apart.\n-rw-r--r-- 1 me me 0 2007-07-24 14:15:47.330927250 +0200 a\n-rw-r--r-- 1 me me 0 2007-07-24 14:15:48.338990250 +0200 a\n\n-- robin\n"},{"id":"48481","messageId":"31e9dd080707240831u1625ea70m629ea325f2101e8b@mail.gmail.com","threadId":"9152","inReplyTo":"200707241457.53414.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Jason Sewall","fromEmail":"jasonsewall@gmail.com","sentAt":"2007-07-24T15:31:07Z","receivedAt":"2007-07-24T15:31:07Z","isPatch":true,"sender":{"key":"jasonsewall@gmail.com","avatar":null},"body":"Fedora 7\nKernel 2.6.22 (SMP)\nCVS 1.11.22\next3 (unsure of version or how to discover version)\n\nAs one would expect from the above, the 'granularity' test you gave my\nreveals 1-second granularity.\n\nOn 7/24/07, Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:\n> tisdag 24 juli 2007 skrev Junio C Hamano:\n> > > Here CVS sleeps. The amount varies between invocations since it\n> > > only sleeps enough for the seconds to wrap.\n> >\n> > Makes one wonder what it would do if you are on a filesystem\n> > with coarser-than-a-second timestamp resolution.\n>\n> Like fat, but then the last test fails on FAT, which wasn't the case. Any other reasonable file\n> systems that comes to your mind?\n>\n> Jason, could you provide us with some more information on OS, fs, cvs version etc.\n>\n> Whether timestamp granularity is larger than a second or not can be checked with this line, I think:\n>\n>         touch a && ls --full-time a && sleep 1 && touch a && ls --full-time a\n>\n> Sample output where the timestamps are roughly one second apart.\n> -rw-r--r-- 1 me me 0 2007-07-24 14:15:47.330927250 +0200 a\n> -rw-r--r-- 1 me me 0 2007-07-24 14:15:48.338990250 +0200 a\n>\n> -- robin\n>\n"},{"id":"48502","messageId":"alpine.LFD.0.999.0707241144490.3607@woody.linux-foundation.org","threadId":"9152","inReplyTo":"200707241134.31950.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-07-24T19:02:06Z","receivedAt":"2007-07-24T19:02:06Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 24 Jul 2007, Robin Rosenberg wrote:\n>\n> 27778 time(NULL)                        = 1185268822\n> 27778 gettimeofday({1185268822, 953340}, NULL) = 0\n> \n> Here CVS sleeps. The amount varies between invocations since it\n> only sleeps enough for the seconds to wrap.\n> \n> 27778 nanosleep({0, 46660000}, NULL)    = 0\n> 27778 time(NULL)                        = 1185268823\n\nBtw, this is *really* dangerous and buggy.\n\nThe reason? The CPU real-time clock is very different from whatever clock \nthe filesystems may use.\n\nFilesystems generally do not use the same clock as the CPU does. That's \nobviously true for things like networked filesystems, but it's actually \ntrue even for local filesystems (even on UP) because the CPU \"realtime\" \nclock rather expensive and much too exact for them. It does all the fancy \nNTP date correction etc, and it has all the complex code to actually make \nsure you don't get any time jumps etc.\n\nSo you should basically assume that all filesystems will use a clock that \nis *close*, but not synchronized with the real-time clock. You have NFS \nissues, but even locally you'd generally expect the local filesystem to be \nbased on a simply clock that is updated by the timer tick, and is \"close \nenough\" to the realtime clock that you get with gettimeofday(). But *not* \nidentical.\n\nSo if you sleep for one second, the filesystem times will update by one \nsecond, but if you try to *synchronize* to exactly one second, it's not at \nall certain that the *filesystem* clock will be synchronized to the same \nsecond! Time skew is simply a fact of life.\n\nA really obvious example of this is NFS. Anybody who thinks that the NFS \ntimes are synchronized to the client real-time clock is just seriously \nmistaken. They may be close, but they won't be identical.\n\nSo I think CVS is simply buggy here. It assumes that \"filesystem time\" is \nthe same as \"CPU time\", and while that sounds like an obvious assumption \nto make, if you think about it for even five seconds (the NFS case above), \nyou realize that it's a totally *buggy* assumption.\n\nIn other words: if you want the timestamps on two files to be one second \napart, you have to sleep one second in between writing them (or you have \nto set the time explicitly with \"utimes()\" or similar). Doing the \n\"optimized sleep\" simply DOES NOT WORK.\n\nSo CVS is buggy. Big surprise. Film at 11.\n\nBtw, if anybody can think of a similar scenario in git, please holler. We \nshouldn't have those kinds of bugs.\n\nSo the things you generally can depend on:\n\n - *within* a single filesystem, the clocks should be comparable (ie you \n   can do \"stat()\" on two files, and compare the date-stamps between the \n   files).\n\n - the clocks should obviously be \"close\" to the local realtime. Time skew \n   is a fact of life, but if time skews by more than a big fraction of a \n   second, something is wrong. It's certainly still very possible (NFS \n   with clients not running NTP), but at least at that point a program can \n   validly say \"badly maintained network, it's the users problem\".\n\nbut depending on exact time syncronization is a really really bad idea.\n\n\t\tLinus\n"},{"id":"48527","messageId":"200707250056.20880.robin.rosenberg.lists@dewire.com","threadId":"9152","inReplyTo":"alpine.LFD.0.999.0707241144490.3607@woody.linux-foundation.org","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-07-24T22:56:20Z","receivedAt":"2007-07-24T22:56:20Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdag 24 juli 2007 skrev Linus Torvalds:\n> \n> On Tue, 24 Jul 2007, Robin Rosenberg wrote:\n> >\n> > 27778 time(NULL)                        = 1185268822\n> > 27778 gettimeofday({1185268822, 953340}, NULL) = 0\n> > \n> > Here CVS sleeps. The amount varies between invocations since it\n> > only sleeps enough for the seconds to wrap.\n> > \n> > 27778 nanosleep({0, 46660000}, NULL)    = 0\n> > 27778 time(NULL)                        = 1185268823\n> \n> Btw, this is *really* dangerous and buggy.\n> \n> The reason? The CPU real-time clock is very different from whatever clock \n> the filesystems may use.\n> \n> Filesystems generally do not use the same clock as the CPU does. That's \n> obviously true for things like networked filesystems, but it's actually \n> true even for local filesystems (even on UP) because the CPU \"realtime\" \n> clock rather expensive and much too exact for them. It does all the fancy \n> NTP date correction etc, and it has all the complex code to actually make \n> sure you don't get any time jumps etc.\n\nHaving our mind enlightened, I propose this or nothing as a workaround. Since\ncvsexportcommit is really a CVS workaround we might work around some bugs\nin CVS itself while we're at it.\n\n-- robin\n\nFrom: Robin Rosenberg <robin.rosenberg@dewire.com>\nDate: Wed, 25 Jul 2007 00:53:24 +0200\nSubject: [PATCH] Sleep in git-cvsexportcommit\n\nIf git cvsexportcommit is executed fast enough in sequence, the CVS\ntimestamps could end up being the same. CVS tries to fix this\nby sleeping until the CPU clock changes seconds. Unfortunately,\nthe CPU clock and the file system clock are not necessarily the same, so\nthe timestamps could be the same anyway. When that happens CVS may not\nrecognize changed files and cvs will forget to commit some files.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n git-cvsexportcommit.perl |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex d6ae99b..f6366be 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -277,6 +277,11 @@ if ($opt_c) {\n # clean up\n unlink(\".cvsexportcommit.diff\");\n \n+# CVS version 1.11.x and 1.12.x sleeps the wrong way to ensure the timestamp \n+# used by CVS and the one set by subsequence file modifications are different.\n+# If they are not different CVS will not detect changes.\n+sleep(1);\n+\n sub usage {\n \tprint STDERR <<END;\n Usage: GIT_DIR=/path/to/.git ${\\basename $0} [-h] [-p] [-v] [-c] [-f] [-m msgprefix] [ parent ] commit\n-- \n1.5.2.3\n"},{"id":"48531","messageId":"alpine.LFD.0.999.0707241608240.3607@woody.linux-foundation.org","threadId":"9152","inReplyTo":"200707250056.20880.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-07-24T23:19:47Z","receivedAt":"2007-07-24T23:19:47Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 25 Jul 2007, Robin Rosenberg wrote:\n> \n> Having our mind enlightened, I propose this or nothing as a workaround. Since\n> cvsexportcommit is really a CVS workaround we might work around some bugs\n> in CVS itself while we're at it.\n\nSide note: I think the reason it came up now is that with CONFIG_NO_HZ the \nLinux filesystem clock will easily be off by half a second even for local \nfilesystems.\n\nWith CONFIG_NO_HZ, we don't update the time as religiously, and as a \nresult, people who look at the low-resolution time (like filesystems) will \nget a noticeable skew.\n\nQuite frankly, that's a Linux kernel bug, and we'll fix it. But it doesn't \nreally invalidate the argument: applications really shouldn't depend on \nthe \"filesystem time\" being in sync with the \"CPU time\", and it may be \nthat the kernel bug was the one that ended up exposing this mis-feature of \nCVS.\n\nNormally, Linux (and probably most other systems) will keep the local \nfilesystems synchronized to within at least one clock-tick of the \nreal-time clock, so the clock skew between filesystems and CPU is at most \nin the \"few millisecond\" range.\n\nThat's also the kind of range that NTP will largely guarantee, so \ngenerally, in most circumstances, while you cannot (and shouldn't) expect \nfilesystem times to be \"accurate\", in most good situations you'll never \nsee skews over a few milliseconds.\n\n(But on the other hand, search for \"kerberos\" and \"time skew\" on google, \nand you see discussions about allowing five *minutes* of skew etc, so \nclearly the model of \"everybody runs NTP\" isn't exactly all of it ;)\n\nSo I suspect that the CVS code is (a) buggy and (b) hard to show the bug \nactually triggering on a well-maintained machine, and that it may well be \nthe case that the only reason it shows up as a bug now is that Jason is \nrunning a recent kernel with CONFIG_NO_HZ. I have no idea what the default \nFedora 7 kernel does.\n\n\t\tLinus\n"},{"id":"48544","messageId":"200707250835.21181.andyparkins@gmail.com","threadId":"9152","inReplyTo":"alpine.LFD.0.999.0707241144490.3607@woody.linux-foundation.org","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-07-25T07:35:19Z","receivedAt":"2007-07-25T07:35:19Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 July 24, Linus Torvalds wrote:\n\n> So if you sleep for one second, the filesystem times will update by one\n> second, but if you try to *synchronize* to exactly one second, it's not at\n> all certain that the *filesystem* clock will be synchronized to the same\n> second! Time skew is simply a fact of life.\n\nI think it's even worse; if memory serves one of the Windows file systems \n(spit) only stores times to a two-second resolution.  So half the time, \nwaiting for one second won't change the time stamp _at all_.\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"48546","messageId":"46A6FF23.8050704@trolltech.com","threadId":"9152","inReplyTo":"200707250835.21181.andyparkins@gmail.com","subject":"Re: [PATCH] Add a 1-second sleep to git-cvsexportcommit test","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2007-07-25T07:43:31Z","receivedAt":"2007-07-25T07:43:31Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Andy Parkins said the following on 25.07.2007 09:35:\n> On Tuesday 2007 July 24, Linus Torvalds wrote:\n> \n>> So if you sleep for one second, the filesystem times will update by one\n>> second, but if you try to *synchronize* to exactly one second, it's not at\n>> all certain that the *filesystem* clock will be synchronized to the same\n>> second! Time skew is simply a fact of life.\n> \n> I think it's even worse; if memory serves one of the Windows file systems \n> (spit) only stores times to a two-second resolution.  So half the time, \n> waiting for one second won't change the time stamp _at all_.\n\n\"File time stamps on FAT drives are rounded to the nearest two seconds \n(even number) when the file is written to the drive. The file time \nstamps on NTFS drives are rounded to the nearest 100 nanoseconds when \nthe file is written to the drive.\"\n\nhttp://support.microsoft.com/kb/127830\n\n-- \n.marius\n\n"}]}