{"thread":{"id":"8047","subject":"[PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","startedAt":"2007-05-08T23:59:20Z","lastAt":"2007-05-14T06:40:05Z","messageCount":15,"participants":["Steffen Prohaska","Johannes Schindelin","Robin Rosenberg","Martin Langhoff","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"41523","messageId":"0056A63A-D511-4FDD-82A6-A13B06E237E9@zib.de","threadId":"8047","inReplyTo":null,"subject":"[PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-05-08T23:59:20Z","receivedAt":"2007-05-08T23:59:20Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"The old implementation executed 'cvs status' for each file touched by  \nthe patch\nto be applied. The new code calls 'cvs status' only once and parses  \ncvs's\noutput to collect status information of all files contained in the  \ncvs working\ncopy.\n\nRuntime is now independent of the number of modified files. A  \ndrawback is that\nthe new code retrieves status information for all files even if only  \na few are\ntouched. The old implementation may be noticeably faster for small  \npatches to\nlarge workingcopies. However, the old implementation doesn't scale if  \nmore\nfiles are touched, especially in remotely located cvs repositories.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\ngit-cvsexportcommit.perl |   45 ++++++++++++++++++++++++++++++++++ \n+----------\n1 files changed, 35 insertions(+), 10 deletions(-)\n\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex 6ed4719..f2c4bc4 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -160,36 +160,61 @@ foreach my $p (@afiles) {\n      }\n}\n+# ... check dirs,\nforeach my $d (@dirs) {\n      if (-e $d) {\n\t$dirty = 1;\n\twarn \"$d exists and is not a directory!\\n\";\n      }\n}\n+# ... query and store status of files by parsing output of 'cvs  \nstatus',\n+my @cvsoutput;\n+my %cvsstat;\n+open CVSSTAT, \"cvs status 2>&1 |\" || die \"failed to query cvs status\";\n+@cvsoutput=<CVSSTAT>;\n+close CVSSTAT || die \"failed to query cvs status\";\n+my ( $dir, $status, $file );\n+foreach my $f (@cvsoutput) {\n+# cvs reports directories on stderr before reporting file status on  \nstdout\n+# using basename of 'Repository revision:' should be a safe way to  \ndeal with whitespace in filenames.\n+    chomp $f;\n+    if ( $f =~ /^cvs status: Examining (.*)$/ ) {\n+        $dir = $1;\n+        if ( $dir ne \".\" ) {\n+            $dir .= \"/\";\n+        } else {\n+            $dir = \"\";\n+        }\n+    } elsif ( $f =~ /Status: (.*)$/ ) {\n+        $status = $1;\n+    } elsif ( $f =~ /^   Repository revision:/ ) {\n+        $f =~ s/,v$//;\n+        $f =~ /([^\\/]*)$/;\n+        $file = $1;\n+        $cvsstat{\"$dir$file\"} = $status;\n+    }\n+}\n+\n+# ... validate new files,\nforeach my $f (@afiles) {\n      # This should return only one value\n      if ($f =~ m,(.*)/[^/]*$,) {\n\tmy $p = $1;\n\tnext if (grep { $_ eq $p } @dirs);\n      }\n-    my @status = grep(m/^File/,  safe_pipe_capture(@cvs, '-q',  \n'status' ,$f));\n-    if (@status > 1) { warn 'Strange! cvs status returned more than  \none line?'};\n-    if (-d dirname $f and $status[0] !~ m/Status: Unknown$/\n-\tand $status[0] !~ m/^File: no file /) {\n+    if (defined ($cvsstat{$f})) {\n   \t$dirty = 1;\n\twarn \"File $f is already known in your CVS checkout -- perhaps it  \nhas been added by another user. Or this may indicate that it exists  \non a different branch. If this is the case, use -f to force the merge. \n\\n\";\n-\twarn \"Status was: $status[0]\\n\";\n+\twarn \"Status was: $cvsstat{$f}\\n\";\n      }\n}\n-\n+# ... validate known files.\nforeach my $f (@files) {\n      next if grep { $_ eq $f } @afiles;\n      # TODO:we need to handle removed in cvs\n-    my @status = grep(m/^File/,  safe_pipe_capture(@cvs, '-q',  \n'status' ,$f));\n-    if (@status > 1) { warn 'Strange! cvs status returned more than  \none line?'};\n-    unless ($status[0] =~ m/Status: Up-to-date$/) {\n+    unless (defined ($cvsstat{$f}) and $cvsstat{$f} eq \"Up-to-date\") {\n\t$dirty = 1;\n-\twarn \"File $f not up to date in your CVS checkout!\\n\";\n+\twarn \"File $f not up to date but has status '$cvsstat{$f}' in your  \nCVS checkout!\\n\";\n      }\n}\nif ($dirty) {\n--\n1.5.1.2\n"},{"id":"41550","messageId":"EC3AE084-0AB8-406A-A3C7-916CCF35BEAE@zib.de","threadId":"8047","inReplyTo":"0056A63A-D511-4FDD-82A6-A13B06E237E9@zib.de","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-05-09T07:42:11Z","receivedAt":"2007-05-09T07:42:11Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn May 9, 2007, at 1:59 AM, Steffen Prohaska wrote:\n\n> The old implementation executed 'cvs status' for each file touched  \n> by the patch\n> to be applied. The new code calls 'cvs status' only once and parses  \n> cvs's\n> output to collect status information of all files contained in the  \n> cvs working\n> copy.\n>\n> [...]\n\nI didn't recognize that my modifications cause the testsuite to fail.  \nI'll send a corrected patch in a minute.\n\nI apologize,\n- Steffen\n"},{"id":"41551","messageId":"82A134F6-C11A-440C-8424-DDDDBF7DCD7A@zib.de","threadId":"8047","inReplyTo":"EC3AE084-0AB8-406A-A3C7-916CCF35BEAE@zib.de","subject":"[PATCH (corrected)] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-05-09T07:45:14Z","receivedAt":"2007-05-09T07:45:14Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"The old implementation executed 'cvs status' for each file touched by  \nthe patch\nto be applied. The new code calls 'cvs status' only once and parses  \ncvs's\noutput to collect status information of all files contained in the  \ncvs working\ncopy.\n\nRuntime is now independent of the number of modified files. A  \ndrawback is that\nthe new code retrieves status information for all files even if only  \na few are\ntouched. The old implementation may be noticeably faster for small  \npatches to\nlarge workingcopies. However, the old implementation doesn't scale if  \nmore\nfiles are touched, especially in remotely located cvs repositories.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\ngit-cvsexportcommit.perl |   48 +++++++++++++++++++++++++++++++++++ \n+---------\n1 files changed, 38 insertions(+), 10 deletions(-)\n\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex 6ed4719..4d91574 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -160,36 +160,64 @@ foreach my $p (@afiles) {\n      }\n}\n+# ... check dirs,\nforeach my $d (@dirs) {\n      if (-e $d) {\n         $dirty = 1;\n         warn \"$d exists and is not a directory!\\n\";\n      }\n}\n+\n+# ... query and store status of files by parsing output of 'cvs  \nstatus',\n+# Note, we must use -n to avoid any modifications to working copy.\n+# Otherwise the testsuite fails because it expects unmodfied CVS/ \nEntries files.\n+my @cvsoutput;\n+my %cvsstat;\n+open CVSSTAT, \"cvs -n status 2>&1 |\" || die \"failed to query cvs  \nstatus\";\n+@cvsoutput=<CVSSTAT>;\n+close CVSSTAT || die \"failed to query cvs status\";\n+my ( $dir, $status, $file );\n+foreach my $f (@cvsoutput) {\n+# cvs reports directories on stderr before reporting file status on  \nstdout\n+# using basename of 'Repository revision:' should be a safe way to  \ndeal with whitespace in filenames.\n+    chomp $f;\n+    if ( $f =~ /^cvs status: Examining (.*)$/ ) {\n+        $dir = $1;\n+        if ( $dir ne \".\" ) {\n+            $dir .= \"/\";\n+        } else {\n+            $dir = \"\";\n+        }\n+    } elsif ( $f =~ /Status: (.*)$/ ) {\n+        $status = $1;\n+    } elsif ( $f =~ /^   Repository revision:/ ) {\n+        $f =~ s/,v$//;\n+        $f =~ /([^\\/]*)$/;\n+        $file = $1;\n+        $cvsstat{\"$dir$file\"} = $status;\n+    }\n+}\n+\n+# ... validate new files,\nforeach my $f (@afiles) {\n      # This should return only one value\n      if ($f =~ m,(.*)/[^/]*$,) {\n         my $p = $1;\n         next if (grep { $_ eq $p } @dirs);\n      }\n-    my @status = grep(m/^File/,  safe_pipe_capture(@cvs, '-q',  \n'status' ,$f));\n-    if (@status > 1) { warn 'Strange! cvs status returned more than  \none line?'};\n-    if (-d dirname $f and $status[0] !~ m/Status: Unknown$/\n-       and $status[0] !~ m/^File: no file /) {\n+    if (defined ($cvsstat{$f})) {\n         $dirty = 1;\n         warn \"File $f is already known in your CVS checkout --  \nperhaps it has been added by another user. Or this may indicate that  \nit exists on a different branch. If this is the case, use -f to force  \nthe merge.\\n\";\n-       warn \"Status was: $status[0]\\n\";\n+       warn \"Status was: $cvsstat{$f}\\n\";\n      }\n}\n-\n+# ... validate known files.\nforeach my $f (@files) {\n      next if grep { $_ eq $f } @afiles;\n      # TODO:we need to handle removed in cvs\n-    my @status = grep(m/^File/,  safe_pipe_capture(@cvs, '-q',  \n'status' ,$f));\n-    if (@status > 1) { warn 'Strange! cvs status returned more than  \none line?'};\n-    unless ($status[0] =~ m/Status: Up-to-date$/) {\n+    unless (defined ($cvsstat{$f}) and $cvsstat{$f} eq \"Up-to-date\") {\n         $dirty = 1;\n-       warn \"File $f not up to date in your CVS checkout!\\n\";\n+       warn \"File $f not up to date but has status '$cvsstat{$f}' in  \nyour CVS checkout!\\n\";\n      }\n}\nif ($dirty) {\n--\n1.5.1.2\n"},{"id":"41571","messageId":"Pine.LNX.4.64.0705091303280.4167@racer.site","threadId":"8047","inReplyTo":"0056A63A-D511-4FDD-82A6-A13B06E237E9@zib.de","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-05-09T11:04:45Z","receivedAt":"2007-05-09T11:04:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 May 2007, Steffen Prohaska wrote:\n\n> The old implementation executed 'cvs status' for each file touched by \n> the patch to be applied.\n\nI did not follow development of that script closely, but could it be that \nthis is a safety valve, to make it unlikely to commit something which was \nchanged by somebody else in the meantime?\n\nCiao,\nDscho\n"},{"id":"41574","messageId":"4BA4CF7D-40CB-4A55-ADDC-56DE179FD6C1@zib.de","threadId":"8047","inReplyTo":"Pine.LNX.4.64.0705091303280.4167@racer.site","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-05-09T11:43:21Z","receivedAt":"2007-05-09T11:43:21Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"Hello,\n\nOn May 9, 2007, at 1:04 PM, Johannes Schindelin wrote:\n\n> On Wed, 9 May 2007, Steffen Prohaska wrote:\n>\n>> The old implementation executed 'cvs status' for each file touched by\n>> the patch to be applied.\n>\n> I did not follow development of that script closely, but could it  \n> be that\n> this is a safety valve, to make it unlikely to commit something  \n> which was\n> changed by somebody else in the meantime?\n\nRight. My patch doesn't change the functionality of the safety check.  \nIt's just a magnitude faster if you commit a lot of files. I'm now  \nable to apply a patch that changes 900 files to a cvs working copy  \nusing ssh over DSL. I wasn't before, at least not in reasonable time.\n\nAnother solution would be to make the safety checks optional as they  \nare not needed for the core functionality. If you have a clean, up-to- \ndate cvs working copy you're fine.\n\n- Steffen\n"},{"id":"41576","messageId":"Pine.LNX.4.64.0705091424190.4167@racer.site","threadId":"8047","inReplyTo":"4BA4CF7D-40CB-4A55-ADDC-56DE179FD6C1@zib.de","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-05-09T12:25:36Z","receivedAt":"2007-05-09T12:25:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 May 2007, Steffen Prohaska wrote:\n\n> On May 9, 2007, at 1:04 PM, Johannes Schindelin wrote:\n> \n> > On Wed, 9 May 2007, Steffen Prohaska wrote:\n> > \n> > > The old implementation executed 'cvs status' for each file touched by\n> > > the patch to be applied.\n> > \n> > I did not follow development of that script closely, but could it be that\n> > this is a safety valve, to make it unlikely to commit something which was\n> > changed by somebody else in the meantime?\n> \n> Right. My patch doesn't change the functionality of the safety check. It's\n> just a magnitude faster if you commit a lot of files. I'm now able to apply a\n> patch that changes 900 files to a cvs working copy using ssh over DSL. I\n> wasn't before, at least not in reasonable time.\n\nWhat I was trying to get at: if you commit 900 files, and after the 450th \nfile somebody _else_ commits a file, which just so happens to be one of \nyour 450 remaining files, that safety check no longer holds.\n\nCVS is slow.\n\nCiao,\nDscho\n"},{"id":"41585","messageId":"3467FF99-9945-4ECF-9282-308759E63ED9@zib.de","threadId":"8047","inReplyTo":"Pine.LNX.4.64.0705091424190.4167@racer.site","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-05-09T13:00:50Z","receivedAt":"2007-05-09T13:00:50Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn May 9, 2007, at 2:25 PM, Johannes Schindelin wrote:\n\n> What I was trying to get at: if you commit 900 files, and after the  \n> 450th\n> file somebody _else_ commits a file, which just so happens to be  \n> one of\n> your 450 remaining files, that safety check no longer holds.\n>\n> CVS is slow.\n\nI know. I'd probably apply my patch late at night or on the weekend,  \nwhen the chance is lower to conflict with other commits.\n\nYou can't remove the race conditions that you have when interacting  \nwith cvs. We can only decrease the chance of being hit by making the  \ntime window smaller. This is a side benefit of my patch. The main  \npurpose is to lower the overall time needed to apply patch that  \nmodifies lots of files.\n\n- Steffen\n"},{"id":"41659","messageId":"200705092230.16027.robin.rosenberg.lists@dewire.com","threadId":"8047","inReplyTo":"0056A63A-D511-4FDD-82A6-A13B06E237E9@zib.de","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-05-09T20:30:15Z","receivedAt":"2007-05-09T20:30:15Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"onsdag 09 maj 2007 skrev Steffen Prohaska:\n> The old implementation executed 'cvs status' for each file touched by  \n> the patch\n> to be applied. The new code calls 'cvs status' only once and parses  \n> cvs's\n> output to collect status information of all files contained in the  \n> cvs working\n> copy.\n> \n> Runtime is now independent of the number of modified files. A  \n> drawback is that\n> the new code retrieves status information for all files even if only  \n> a few are\n> touched. The old implementation may be noticeably faster for small  \n> patches to\n\nOuch, lets see now. My working cvs checkout contains ~25k files and\nmy typical commit touches 5-20 files. \n\nA quick (well....) test says cvs status on my checkout takes about\nfive minutes to execute. Compare this with my typical exportcommit\ntime of about ten seconds. \n\nIf you really need this, make a switch to select it.\n\nStill we're missing a check for the case that new files/directories have been\nadded on the server, but are missing from the checkout, or why not run\nan update first. If you are commit this number of large files you'll need that\ncheck, or it's hurt a lot when things fail.\n\n> large workingcopies. However, the old implementation doesn't scale if  \n> more\n> files are touched, especially in remotely located cvs repositories.\n\nHow come your commit are so large you'd prefer this behaviour?\n\n-- robin\n"},{"id":"41681","messageId":"380B28A3-5CD0-4371-A717-1D2629E6302D@zib.de","threadId":"8047","inReplyTo":"200705092230.16027.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-05-09T22:45:10Z","receivedAt":"2007-05-09T22:45:10Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn May 9, 2007, at 10:30 PM, Robin Rosenberg wrote:\n\n> onsdag 09 maj 2007 skrev Steffen Prohaska:\n>> The old implementation executed 'cvs status' for each file touched by\n>> the patch\n>> to be applied. The new code calls 'cvs status' only once and parses\n>> cvs's\n>> output to collect status information of all files contained in the\n>> cvs working\n>> copy.\n>>\n>> Runtime is now independent of the number of modified files. A\n>> drawback is that\n>> the new code retrieves status information for all files even if only\n>> a few are\n>> touched. The old implementation may be noticeably faster for small\n>> patches to\n>\n> Ouch, lets see now. My working cvs checkout contains ~25k files and\n> my typical commit touches 5-20 files.\n>\n> A quick (well....) test says cvs status on my checkout takes about\n> five minutes to execute. Compare this with my typical exportcommit\n> time of about ten seconds.\n\nI tested with ~7k files using ssh to connect. Maybe something's wrong\nwith the server I'm connecting to but it takes some time for each  \nconnect.\nThis alone kills the performance for a couple of files.\n\n'cvs -z6 status' on the other hand took only 10 seconds.\n\n> If you really need this, make a switch to select it.\n\nI'll post a patch soon that takes the best of both: Call cvs status\nonce with the list of touched files and parse the output. Only one\nconnection is needed and only the minimal amount of status data is\ntransferred.\n\n- Steffen\n"},{"id":"41683","messageId":"11787519961666-git-send-email-prohaska@zib.de","threadId":"8047","inReplyTo":"380B28A3-5CD0-4371-A717-1D2629E6302D@zib.de","subject":"[PATCH] Optimized cvsexportcommit: calling 'cvs status' once instead of once per touched file.","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-05-09T23:06:36Z","receivedAt":"2007-05-09T23:06:36Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"Runtime is now independent of the number of modified files.\n\nThe old implementation executed 'cvs status' for each file touched by the patch\nto be applied. The new code calls 'cvs status' only once with all touched files\nand parses cvs's output to collect all available status information.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n git-cvsexportcommit.perl |   45 ++++++++++++++++++++++++++++++---------------\n 1 files changed, 30 insertions(+), 15 deletions(-)\n\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex 6ed4719..21d49f6 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -160,36 +160,51 @@ foreach my $p (@afiles) {\n     }\n }\n \n+# ... check dirs,\n foreach my $d (@dirs) {\n     if (-e $d) {\n \t$dirty = 1;\n \twarn \"$d exists and is not a directory!\\n\";\n     }\n }\n-foreach my $f (@afiles) {\n-    # This should return only one value\n-    if ($f =~ m,(.*)/[^/]*$,) {\n-\tmy $p = $1;\n-\tnext if (grep { $_ eq $p } @dirs);\n+\n+# ... query status of all files that we have a directory for and parse output of 'cvs status' to %cvsstat.\n+my @canstatusfiles;\n+foreach my $f (@files) {\n+    my $path = dirname $f;\n+    next if (grep { $_ eq $path } @dirs);\n+    push @canstatusfiles, $f;\n+}\n+  \n+my %cvsstat;\n+if (@canstatusfiles) {\n+    my @cvsoutput;\n+    @cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);\n+    my $matchcount = 0;\n+    foreach my $l (@cvsoutput) {\n+        chomp $l;\n+        if ( $l =~ /^File:/ and  $l =~ /Status: (.*)$/ ) { \n+            $cvsstat{$canstatusfiles[$matchcount]} = $1;\n+            $matchcount++;\n+        }\n     }\n-    my @status = grep(m/^File/,  safe_pipe_capture(@cvs, '-q', 'status' ,$f));\n-    if (@status > 1) { warn 'Strange! cvs status returned more than one line?'};\n-    if (-d dirname $f and $status[0] !~ m/Status: Unknown$/\n-\tand $status[0] !~ m/^File: no file /) {\n+}\n+\n+# ... validate new files,\n+foreach my $f (@afiles) {\n+    if (defined ($cvsstat{$f}) and $cvsstat{$f} ne \"Unknown\") {\n  \t$dirty = 1;\n \twarn \"File $f is already known in your CVS checkout -- perhaps it has been added by another user. Or this may indicate that it exists on a different branch. If this is the case, use -f to force the merge.\\n\";\n-\twarn \"Status was: $status[0]\\n\";\n+\twarn \"Status was: $cvsstat{$f}\\n\";\n     }\n }\n-\n+# ... validate known files. \n foreach my $f (@files) {\n     next if grep { $_ eq $f } @afiles;\n     # TODO:we need to handle removed in cvs\n-    my @status = grep(m/^File/,  safe_pipe_capture(@cvs, '-q', 'status' ,$f));\n-    if (@status > 1) { warn 'Strange! cvs status returned more than one line?'};\n-    unless ($status[0] =~ m/Status: Up-to-date$/) {\n+    unless (defined ($cvsstat{$f}) and $cvsstat{$f} eq \"Up-to-date\") {\n \t$dirty = 1;\n-\twarn \"File $f not up to date in your CVS checkout!\\n\";\n+\twarn \"File $f not up to date but has status '$cvsstat{$f}' in your CVS checkout!\\n\";\n     }\n }\n if ($dirty) {\n-- \n1.5.1.2\n"},{"id":"41705","messageId":"46a038f90705092353x107c738foa7db547ab29b1748@mail.gmail.com","threadId":"8047","inReplyTo":"380B28A3-5CD0-4371-A717-1D2629E6302D@zib.de","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-05-10T06:53:51Z","receivedAt":"2007-05-10T06:53:51Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/10/07, Steffen Prohaska <prohaska@zib.de> wrote:\n> I'll post a patch soon that takes the best of both: Call cvs status\n> once with the list of touched files and parse the output. Only one\n> connection is needed and only the minimal amount of status data is\n> transferred.\n\nYes, please :-) I wrote cvsexportcommit originally, and use it on a\nhuge cvs checkout that is hosted on SF.net (slow!). My commits are\nsmall (3~5 files). I agree with using only one connection so commits\nwith many files are sanity-checked faster, but status needs to ask\nexplicitly about the files it's about to touch.\n\ncheers,\n\n\nm\n"},{"id":"41708","messageId":"7vd519m9z7.fsf@assigned-by-dhcp.cox.net","threadId":"8047","inReplyTo":"46a038f90705092353x107c738foa7db547ab29b1748@mail.gmail.com","subject":"Re: [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-10T07:08:44Z","receivedAt":"2007-05-10T07:08:44Z","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 5/10/07, Steffen Prohaska <prohaska@zib.de> wrote:\n>> I'll post a patch soon that takes the best of both: Call cvs status\n>> once with the list of touched files and parse the output. Only one\n>> connection is needed and only the minimal amount of status data is\n>> transferred.\n>\n> Yes, please :-) I wrote cvsexportcommit originally, and use it on a\n> huge cvs checkout that is hosted on SF.net (slow!). My commits are\n> small (3~5 files). I agree with using only one connection so commits\n> with many files are sanity-checked faster, but status needs to ask\n> explicitly about the files it's about to touch.\n>\n> cheers,\n\nSounds like you are perfect guinea pig.  A test in the real-life\nuse followed by an Ack is very appreciated.\n"},{"id":"42057","messageId":"7vps54qvya.fsf_-_@assigned-by-dhcp.cox.net","threadId":"8047","inReplyTo":"7vd519m9z7.fsf@assigned-by-dhcp.cox.net","subject":"RFH for [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-13T21:01:49Z","receivedAt":"2007-05-13T21:01:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I'd like to have feedbacks on this patch, as I think what it\ntries to do is sensible and worth to have it in v1.5.2 if it\nworks for people.\n\nAck?  Nack?  YesButNeedsmorework?\n"},{"id":"42058","messageId":"200705132351.24867.robin.rosenberg.lists@dewire.com","threadId":"8047","inReplyTo":"7vps54qvya.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: RFH for [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-05-13T21:51:24Z","receivedAt":"2007-05-13T21:51:24Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"söndag 13 maj 2007 skrev Junio C Hamano:\n> I'd like to have feedbacks on this patch, as I think what it\n> tries to do is sensible and worth to have it in v1.5.2 if it\n> works for people.\n> \n> Ack?  Nack?  YesButNeedsmorework?\n\nLooks good, but I haven't tried it for production work yet.\n\n-- robin\n"},{"id":"42097","messageId":"46a038f90705132340o4006d2f1gbad841144a4c8054@mail.gmail.com","threadId":"8047","inReplyTo":"200705132351.24867.robin.rosenberg.lists@dewire.com","subject":"Re: RFH for [PATCH] Optimized cvsexportcommit: calling 'cvs status' only once instead of once per changed file.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-05-14T06:40:05Z","receivedAt":"2007-05-14T06:40:05Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/14/07, Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:\n> söndag 13 maj 2007 skrev Junio C Hamano:\n> > I'd like to have feedbacks on this patch, as I think what it\n> > tries to do is sensible and worth to have it in v1.5.2 if it\n> > works for people.\n> >\n> > Ack?  Nack?  YesButNeedsmorework?\n>\n> Looks good, but I haven't tried it for production work yet.\n\nSame here - got it in my dev system, but haven't had a chance to use\nit in real-life.\n\nm\n"}]}