{"thread":{"id":"6276","subject":"[PATCH] cvsimport: skip commits that are too recent","startedAt":"2007-01-08T01:11:23Z","lastAt":"2007-01-08T03:18:59Z","messageCount":5,"participants":["Martin Langhoff","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"31096","messageId":"1168218683853-git-send-email-martin@catalyst.net.nz","threadId":"6276","inReplyTo":null,"subject":"[PATCH] cvsimport: skip commits that are too recent","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2007-01-08T01:11:23Z","receivedAt":"2007-01-08T01:11:23Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"With this patch, cvsimport will skip commits made\nin the last 10 minutes. The recent-ness test is of\n5 minutes + cvsps fuzz window (5 minutes default).\n\nWhen working with a CVS repository that is in use,\nimporting commits that are too recent can lead to\npartially incorrect trees. This is mainly due to\n\n - Commits that are within the cvsps fuzz window may later\n   be found to have affected more files.\n\n - When performing incremental imports, clock drift between\n   the systems may lead to skipped commits.\n\nThis commit helps keep incremental imports of in-use\nCVS repositories sane.\n\nSigned-off-by: Martin Langhoff <martin@catalyst.net.nz>\n---\n git-cvsimport.perl |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex c5bf2d1..2686775 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -129,6 +129,11 @@ if ($opt_M) {\n \tpush (@mergerx, qr/$opt_M/);\n }\n \n+# Remember UTC of our starting time\n+# we'll want to avoid importing commits\n+# that are too recent\n+our $starttime = time();\n+\n select(STDERR); $|=1; select(STDOUT);\n \n \n@@ -824,6 +829,15 @@ while (<CVS>) {\n \t\t\t$state = 11;\n \t\t\tnext;\n \t\t}\n+\t\tif ( $starttime - 300 - (defined $opt_z ? $opt_z : 300) <= $date) {\n+\t\t\t# skip if the commit is too recent\n+\t\t\t# that the cvsps default fuzz is 300s, we give ourselves another\n+\t\t\t# 300s just in case -- this also prevents skipping commits\n+\t\t\t# due to server clock drift\n+\t\t\tprint \"skip patchset $patchset: $date too recent\\n\" if $opt_v;\n+\t\t\t$state = 11;\n+\t\t\tnext;\n+\t\t}\n \t\tif (exists $ignorebranch{$branch}) {\n \t\t\tprint STDERR \"Skipping $branch\\n\";\n \t\t\t$state = 11;\n-- \n1.5.0.rc0.g4017-dirty\n"},{"id":"31103","messageId":"7virfiz3at.fsf@assigned-by-dhcp.cox.net","threadId":"6276","inReplyTo":"1168218683853-git-send-email-martin@catalyst.net.nz","subject":"Re: [PATCH] cvsimport: skip commits that are too recent","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-08T01:59:38Z","receivedAt":"2007-01-08T01:59:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Langhoff <martin@catalyst.net.nz> writes:\n\n> With this patch, cvsimport will skip commits made\n> in the last 10 minutes. The recent-ness test is of\n> 5 minutes + cvsps fuzz window (5 minutes default).\n>\n> When working with a CVS repository that is in use,\n> importing commits that are too recent can lead to\n> partially incorrect trees. This is mainly due to\n>\n>  - Commits that are within the cvsps fuzz window may later\n>    be found to have affected more files.\n>\n>  - When performing incremental imports, clock drift between\n>    the systems may lead to skipped commits.\n\nHmmmmm.  This is good for tracking other people's work, but, I\nam not quite sure how well it works with my workflow.\n\nI have a CVS upstream, but I manage my own development with git.\nI start my day by running an incremental cvsimport, rebase my\nbranch on top of whatever at the tip of the cvsimport branch.  I\nuse cvsexportcommit (actually a moral equivalent of it I've been\nusing before cvsexportcommit has become part of git) to make\nparts of my branch that are ready for other people's consumption\navailable by making commits on the CVS side.  Almost immediately\nafter that, I do another incremental cvsimport so that I can\nrebase the remainder of my branch on top of what I made public.\n\nI guess there is no negative impact your patch has on me -- this\n10 minute window does not mean that I cannot continue working.\nI can keep working on my stuff on my (old) branch without the\nsecond cvsimport and rebase and there is nothing lost.  I can do\nthe second cvsimport and rebase later.\n\nWhich means that you did not give me a new excuse to take a\ncoffee break and work on git stuff instead of my day job project\nto my management but that is Ok.  I'll find other ways ;-).\n"},{"id":"31104","messageId":"46a038f90701071813g7b892af1y2cfa620ef2656657@mail.gmail.com","threadId":"6276","inReplyTo":"7virfiz3at.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] cvsimport: skip commits that are too recent","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-01-08T02:13:32Z","receivedAt":"2007-01-08T02:13:32Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 1/8/07, Junio C Hamano <junkio@cox.net> wrote:\n>  Almost immediately\n> after that, I do another incremental cvsimport so that I can\n> rebase the remainder of my branch on top of what I made public.\n\nThat probably means I should have added a\n--force-fetch-all-and-i-mean-it flag to override the cautious\nbehaviour. I'll repost ina few hours, with doco too.\n\n ...\n\n> Which means that you did not give me a new excuse to take a\n> coffee break and work on git stuff instead of my day job project\n> to my management but that is Ok.  I'll find other ways ;-).\n\nI'll try harder next time ;-)\n\ncheers\n\n\nmartin\n"},{"id":"31106","messageId":"7vd55qz2d1.fsf@assigned-by-dhcp.cox.net","threadId":"6276","inReplyTo":"46a038f90701071813g7b892af1y2cfa620ef2656657@mail.gmail.com","subject":"Re: [PATCH] cvsimport: skip commits that are too recent","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-08T02:19:54Z","receivedAt":"2007-01-08T02:19:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n\n> On 1/8/07, Junio C Hamano <junkio@cox.net> wrote:\n>>  Almost immediately\n>> after that, I do another incremental cvsimport so that I can\n>> rebase the remainder of my branch on top of what I made public.\n>\n> That probably means I should have added a\n> --force-fetch-all-and-i-mean-it flag to override the cautious\n> behaviour. I'll repost ina few hours, with doco too.\n\nWell I meant to say that my conclusion is that that flag is not\nneeded in practice.\n\n>\n> ...\n>\n>> Which means that you did not give me a new excuse to take a\n>> coffee break and work on git stuff instead of my day job project\n>> to my management but that is Ok.  I'll find other ways ;-).\n>\n> I'll try harder next time ;-)\n>\n> cheers\n>\n>\n> martin\n"},{"id":"31112","messageId":"46a038f90701071918y4a8078can90ae69dd1d9f9ffd@mail.gmail.com","threadId":"6276","inReplyTo":"7vd55qz2d1.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] cvsimport: skip commits that are too recent","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-01-08T03:18:59Z","receivedAt":"2007-01-08T03:18:59Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 1/8/07, Junio C Hamano <junkio@cox.net> wrote:\n> Well I meant to say that my conclusion is that that flag is not\n> needed in practice.\n\nyou are getting soft in your old age, man :-)\n\nMore seriously, as soon as I sent the patch I thought of the use case\nyou describe. Not everyone is as patient as you are, and someone may\nhave things scripted. If the cvs repo is local/fast and under your\ncontrol, it doesn't make sense to be _so_ conservative.\n\nAlso -- by having the flag we get an excuse to mention it in the doco.\n\n\nm\n"}]}