{"thread":{"id":"4292","subject":"git-cvsserver wart?","startedAt":"2006-05-25T16:42:49Z","lastAt":"2006-05-26T03:57:56Z","messageCount":8,"participants":["Cameron McBride","Martin Langhoff"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"20690","messageId":"dcedf5e20605250942g6a7417dfh5f2f26df29842def@mail.gmail.com","threadId":"4292","inReplyTo":null,"subject":"git-cvsserver wart?","fromName":"Cameron McBride","fromEmail":"cameron.mcbride@gmail.com","sentAt":"2006-05-25T16:42:49Z","receivedAt":"2006-05-25T16:42:49Z","isPatch":false,"sender":{"key":"cameron.mcbride@gmail.com","avatar":"https://gravatar.com/avatar/0b1b250c27badde703e1baca6f19ee0aee7213638f59f52b17e701c40a7dcce4?d=mp&s=160"},"body":"I'm a new git user, so if I'm doing something boneheaed - sharp kicks\nare welcome.\n\nFor reasons I won't go into, the ability to use cvs clients is darn\nnear crucial.  Although most development is local (where I install /\nuse git), pulling down the latest updates and pushing up minor changes\nvia CVS is helpful at remote locations where I don't want to maintain\nclients.  Git with git-cvsserver makes this very nice.   Thanks to\nall!\n\nNow, the problem I ran into:\n\ncode/ntropy> cvs up\nCan't use an undefined value as an ARRAY reference at\n/usr/local/bin/git-cvsserver line 761.\nclosing dbh with active statement handles\ncvs [update aborted]: end of file from server (consult above messages if any)\ncode/ntropy> cvs -v\nConcurrent Versions System (CVS) 1.11.1p1 (client/server)\n\nDoing a 'cvs up -dP' (or either of the two individually) seems to work fine.\n\nso, it's an old client, a newer client doesn't have this problem.  a\nbare 'cvs up' works fine on:\nConcurrent Versions System (CVS) 1.11.17 (client/server)\n\nJust to be clear, it appears everything gets updated with the\nworkaround - but there might be something else amiss, so I thought it\nwas worth mentioning.\n\nCameron\n\np.s.  I'm assuming the following statement is harmless (it's always present):\nclosing dbh with active statement handles\n"},{"id":"20709","messageId":"46a038f90605251419kd45fbj419565eabdd63182@mail.gmail.com","threadId":"4292","inReplyTo":"dcedf5e20605250942g6a7417dfh5f2f26df29842def@mail.gmail.com","subject":"Re: git-cvsserver wart?","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-05-25T21:19:19Z","receivedAt":"2006-05-25T21:19:19Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/26/06, Cameron McBride <cameron.mcbride@gmail.com> wrote:\n> For reasons I won't go into, the ability to use cvs clients is darn\n> near crucial.  Although most development is local (where I install /\n> use git), pulling down the latest updates and pushing up minor changes\n> via CVS is helpful at remote locations where I don't want to maintain\n> clients.  Git with git-cvsserver makes this very nice.   Thanks to\n> all!\n\nNP!\n\nThere's been some recent changes to cvsserver -- so version info is\ncrucial. What git version are you using? Can you try with the lastest\n#master head from Junio? That's the latest and greatest...\n\nIf that doesn't fix it, can you post the logs? I think you have to\ndeclare CVS_LOG=/tmp/cvslog or somesuch.\n\n> code/ntropy> cvs -v\n> Concurrent Versions System (CVS) 1.11.1p1 (client/server)\n\nWe've developed it testing against 1.12.9 from debian and 1.11.20 from\nMacOSX/fink.\n\n> so, it's an old client, a newer client doesn't have this problem.  a\n> bare 'cvs up' works fine on:\n> Concurrent Versions System (CVS) 1.11.17 (client/server)\n\nAh! Then capturing the logs of the working and non-working clients,\nand comparing them can probably help. Can you capture and post the\nrelevant parts of the log...?\n\n> p.s.  I'm assuming the following statement is harmless (it's always present):\n> closing dbh with active statement handles\n\nYup. Harmless indeed. They way we are using prepared statements, I\ndon't know how to avoid it :-/ -- suggestions welcome.\n\ncheers,\n\n\nmartin\n"},{"id":"20726","messageId":"dcedf5e20605252011v6738dc9dg3d4801144d3e9898@mail.gmail.com","threadId":"4292","inReplyTo":"46a038f90605251419kd45fbj419565eabdd63182@mail.gmail.com","subject":"Re: git-cvsserver wart?","fromName":"Cameron McBride","fromEmail":"cameron.mcbride@gmail.com","sentAt":"2006-05-26T03:11:55Z","receivedAt":"2006-05-26T03:11:55Z","isPatch":false,"sender":{"key":"cameron.mcbride@gmail.com","avatar":"https://gravatar.com/avatar/0b1b250c27badde703e1baca6f19ee0aee7213638f59f52b17e701c40a7dcce4?d=mp&s=160"},"body":"On 5/25/06, Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> On 5/26/06, Cameron McBride <cameron.mcbride@gmail.com> wrote:\n\n> There's been some recent changes to cvsserver -- so version info is\n> crucial. What git version are you using? Can you try with the lastest\n> #master head from Junio? That's the latest and greatest...\n\nsorry, my bad. This error was discovered using the git stable, v1.3.3.\n Grabbing the latest at git://git.kernel.org/pub/scm/git/git.git\nshowed the same problem.\n\n> If that doesn't fix it, can you post the logs? I think you have to\n> declare CVS_LOG=/tmp/cvslog or somesuch.\n\nI'm assuming you mean the log from git-cvsserver (set via git/config\nwith logfile=...)\n\nBesides the log cutoff in the broken attempt, it appears the culprit\nis a lack of arguments being passed down as that is the only\ndifference in the logs.  Specifically, the working versions output\n'Arguments : (something) ' which seemed to come from the\nreq_Argument()\nsubroutine around line 550 (in the case of newer CVS, the output is '--').\n\nAnyhow, the error seems to be that $state->{args} is not getting\ninitialized.  In the newer version, there seemed to be additional\nuninitialized variables, e.g. $state->{prependdir}.  These might be\nsigns of some larger problem (where the $state isn't getting set\nproperly).\n\nTo quiet it down and get it to run - a crude hack seemed to work\n(included below).  I didn't test any of this much, nor do I really\nunderstand the whole of what's going on - my alterations just seemed\nto allow 'cvs up' to complete without errors or warnings from both\nclients.  Not a very robust criteria, so please review.\n\nCameron\n\n--\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 5ccca4f..a52e838 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -1702,6 +1702,7 @@ sub argsfromdir\n {\n     my $updater = shift;\n\n+    $state->{args} = [] unless defined($state->{args});\n     $state->{args} = [] if ( scalar(@{$state->{args}}) == 1 and\n$state->{args}[0] eq \".\" );\n\n     return if ( scalar ( @{$state->{args}} ) > 1 );\n@@ -1729,7 +1730,11 @@ sub argsfromdir\n         foreach my $file ( @{$updater->gethead} )\n         {\n             next if ( $file->{filehash} eq \"deleted\" and not defined\n( $state->{entries}{$file->{name}} ) );\n-            next unless ( $file->{name} =~ s/^$state->{prependdir}// );\n+            if( defined($state->{prependdir} ) )\n+            {\n+                $file->{name} =~ s/^$state->{prependdir}//;\n+            }\n+            next unless ( $file->{name} );\n             push @{$state->{args}}, $file->{name};\n         }\n     }\n@@ -1812,7 +1817,7 @@ sub filenamesplit\n     ( $filepart, $dirpart ) = ( $2, $1 ) if ( $filename =~ /(.*)\\/(.*)/ );\n     $dirpart .= \"/\";\n\n-    if ( $fixforlocaldir )\n+    if ( $fixforlocaldir and defined($state->{prependdir}))\n     {\n         $dirpart =~ s/^$state->{prependdir}//;\n     }\n@@ -1832,7 +1837,10 @@ sub filecleanup\n     }\n\n     $filename =~ s/^\\.\\///g;\n-    $filename = $state->{prependdir} . $filename;\n+    if( defined($state->{prependdir}) )\n+    {\n+        $filename = $state->{prependdir} . $filename;\n+    }\n     return $filename;\n }\n"},{"id":"20728","messageId":"46a038f90605252023v5ff3fd65l9a991b3bbfa0a024@mail.gmail.com","threadId":"4292","inReplyTo":"dcedf5e20605252011v6738dc9dg3d4801144d3e9898@mail.gmail.com","subject":"Re: git-cvsserver wart?","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-05-26T03:23:22Z","receivedAt":"2006-05-26T03:23:22Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/26/06, Cameron McBride <cameron.mcbride@gmail.com> wrote:\n> sorry, my bad. This error was discovered using the git stable, v1.3.3.\n>  Grabbing the latest at git://git.kernel.org/pub/scm/git/git.git\n> showed the same problem.\n\nOk. You might want to retain that latest, it has some further fixes ;-)\n\n> > If that doesn't fix it, can you post the logs? I think you have to\n> > declare CVS_LOG=/tmp/cvslog or somesuch.\n>\n> I'm assuming you mean the log from git-cvsserver (set via git/config\n> with logfile=...)\n\nI was actually thinking of setting the environment at the client end:\nCVS_CLIENT_LOG,\nhttp://cvsbook.red-bean.com/cvsbook.html#$CVS_CLIENT_LOG but it looks\nlike you've got it mostly sorted.\n\n> Besides the log cutoff in the broken attempt, it appears the culprit\n> is a lack of arguments being passed down as that is the only\n> difference in the logs.\n\nYes, I was guessing as much. I am still curious about what parameters\n(and in what order) cvs 1.11.7 sends...\n\n> To quiet it down and get it to run - a crude hack seemed to work\n\nIt looks reasonable as a means to shut it up, but perhaps if we can\nfigure out what the client is telling us... ;-)\n\n\nmartin\n"},{"id":"20729","messageId":"dcedf5e20605252024q5bf51486o7cbf6cc396b18b5d@mail.gmail.com","threadId":"4292","inReplyTo":"dcedf5e20605252011v6738dc9dg3d4801144d3e9898@mail.gmail.com","subject":"Re: git-cvsserver wart?","fromName":"Cameron McBride","fromEmail":"cameron.mcbride@gmail.com","sentAt":"2006-05-26T03:24:53Z","receivedAt":"2006-05-26T03:24:53Z","isPatch":false,"sender":{"key":"cameron.mcbride@gmail.com","avatar":"https://gravatar.com/avatar/0b1b250c27badde703e1baca6f19ee0aee7213638f59f52b17e701c40a7dcce4?d=mp&s=160"},"body":"Does cvs commit upstream work?  In my testing, I can't get 'cvs ci' to\nfunction on a git repo.\n\nThis seems to be broken with v1.3.3 and latest 1.3.3.ged90.  The cvs\nclients are the same as before 1.11.1p1 and 1.11.17\n\nThe cvs client exits with:\nIndex already exists in git repo\n\nThe log (for git version 1.3.3.ged90):\n\nINFO  - --------------- STARTING -----------------\nDEBUG - Temporary directory is '/tmp/UvaWwud8fs'\nDEBUG - req_Root : /export/home/cameron/ws/git_test/ntropy.git\nDEBUG - req_Validresponses : ok error Valid-requests Checked-in\nNew-entry Checksum Copy-file Updated Created Update-existing Merged\nPatched Rcs-diff Mode Mod-time Removed Remove-entry\nSet-static-directory Clear-static-directory Set-sticky Clear-sticky\nTemplate Set-checkin-prog Set-update-prog Notified Module-expansion\nWrapper-rcsOption M Mbinary E F MT               DEBUG -\nreq_validrequests\nDEBUG - SEND : Valid-requests remove add status Entry watchers ci tag\nlog co Modified Questionable admin Root history valid-requests\nGlobal_option Argumentx annotate Valid-responses Unchanged Directory\nrlog Argument expand-modules diff editors update\n\n                         DEBUG - SEND : ok\nDEBUG - Argument : -m\nDEBUG - Argument : ncsa mod\nDEBUG - req_Directory : localdir=.\nrepository=/export/home/cameron/ws/git_test/ntropy.git/master path=\ndirectory= module=master\n\n INFO  - Received entry line '/README/1.7///' => 'README'\nDEBUG - Argument : README\nINFO  - req_ci : [NULL]\nWARN  - file 'index' already exists in the git repository\n\nLet me know if any additional information is useful, I didn't have\nmuch time to dig into this.\n\nCameron\n"},{"id":"20730","messageId":"46a038f90605252028h556d0b2aob43f5c3dca8a5392@mail.gmail.com","threadId":"4292","inReplyTo":"dcedf5e20605252024q5bf51486o7cbf6cc396b18b5d@mail.gmail.com","subject":"Re: git-cvsserver wart?","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-05-26T03:28:11Z","receivedAt":"2006-05-26T03:28:11Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/26/06, Cameron McBride <cameron.mcbride@gmail.com> wrote:\n> WARN  - file 'index' already exists in the git repository\n\nThis warning means that you are running git-cvsserver off a repo where\nyou also have a checkout. git-cvsserver really expects to be running\noff a 'naked' or 'bare' repo. For read only ops I think it kind-of\nworks in a 'checkout' repo, but commits are a different story.\n\ncheers,\n\n\nm\n"},{"id":"20732","messageId":"dcedf5e20605252034y8171d32x57d9d8d575443612@mail.gmail.com","threadId":"4292","inReplyTo":"46a038f90605252028h556d0b2aob43f5c3dca8a5392@mail.gmail.com","subject":"Re: git-cvsserver wart?","fromName":"Cameron McBride","fromEmail":"cameron.mcbride@gmail.com","sentAt":"2006-05-26T03:34:21Z","receivedAt":"2006-05-26T03:34:21Z","isPatch":false,"sender":{"key":"cameron.mcbride@gmail.com","avatar":"https://gravatar.com/avatar/0b1b250c27badde703e1baca6f19ee0aee7213638f59f52b17e701c40a7dcce4?d=mp&s=160"},"body":"On 5/25/06, Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> On 5/26/06, Cameron McBride <cameron.mcbride@gmail.com> wrote:\n> > WARN  - file 'index' already exists in the git repository\n>\n> This warning means that you are running git-cvsserver off a repo where\n> you also have a checkout. git-cvsserver really expects to be running\n> off a 'naked' or 'bare' repo. For read only ops I think it kind-of\n> works in a 'checkout' repo, but commits are a different story.\n\nhmmm, it is supposed to be a bare repo.  perhaps I flubbed something\nup.  Can I safely delete this index file?  It's in the repo.git\ndirectory.  Perhaps it got created on the initial import from CVS\n(using cvsimport and cvsps)?\n\nCameron\n"},{"id":"20733","messageId":"dcedf5e20605252057n28e77bbdt8094498ce8d496a0@mail.gmail.com","threadId":"4292","inReplyTo":"46a038f90605252023v5ff3fd65l9a991b3bbfa0a024@mail.gmail.com","subject":"Re: git-cvsserver wart?","fromName":"Cameron McBride","fromEmail":"cameron.mcbride@gmail.com","sentAt":"2006-05-26T03:57:56Z","receivedAt":"2006-05-26T03:57:56Z","isPatch":false,"sender":{"key":"cameron.mcbride@gmail.com","avatar":"https://gravatar.com/avatar/0b1b250c27badde703e1baca6f19ee0aee7213638f59f52b17e701c40a7dcce4?d=mp&s=160"},"body":"On 5/25/06, Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> On 5/26/06, Cameron McBride <cameron.mcbride@gmail.com> wrote:\n> Ok. You might want to retain that latest, it has some further fixes ;-)\n\nsounds good.\n\n> Yes, I was guessing as much. I am still curious about what parameters\n> (and in what order) cvs 1.11.7 sends...\n\nsure!  now that I know CVS_CLIENT_LOG exists ... ;)\n\nIt points in basically the same direction, which is to say the newer\nclient passes an 'Argument -- ' which is what git-cvsserver seems to\nbe choking on.\n\nThe 'in' versions of the two\nnoup: cvs 1.11.1p1 that failed plane cvs update\nwork: cvs 1.11.17 that worked\n\n--- cvs_noup.log.in     2006-05-25 23:44:21.000000000 -0400\n+++ cvs_work.log.in     2006-05-25 23:48:38.000000000 -0400\n@@ -1,6 +1,7 @@\n Root /export/home/cameron/ws/git_test/ntropy.git\n-Valid-responses ok error Valid-requests Checked-in New-entry Checksum\nCopy-file Updated Created Update-existing Merged Patched Rcs-diff Mode\nMod-time Removed Remove-entry Set-static-directory\nClear-static-directory Set-sticky Clear-sticky Template\nSet-checkin-prog Set-update-prog Notified Module-expansion\nWrapper-rcsOption M Mbinary E F MT\n+Valid-responses ok error Valid-requests Checked-in New-entry Checksum\nCopy-file Updated Created Update-existing Merged Patched Rcs-diff Mode\nMod-time Removed Remove-entry Set-static-directory\nClear-static-directory Set-sticky Clear-sticky Template Notified\nModule-expansion Wrapper-rcsOption M Mbinary E F MT\n valid-requests\n+Argument --\n Directory .\n /export/home/cameron/ws/git_test/ntropy.git/master\n Entry /.gitignore/1.1///\n\nThanks for your help!\n\nCameron\n"}]}