{"thread":{"id":"14504","subject":"[PATCH] testsuite for cvs co -c","startedAt":"2008-07-17T10:01:12Z","lastAt":"2008-07-17T17:53:03Z","messageCount":11,"participants":["Lars Noschinski","Johannes Schindelin","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"83664","messageId":"1216288877-12140-1-git-send-email-lars@public.noschinski.de","threadId":"14504","inReplyTo":null,"subject":"Some cvs related fixes and enhancements","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2008-07-17T10:01:12Z","receivedAt":"2008-07-17T10:01:12Z","isPatch":false,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"\nThis patch series\n\n    - fixes a small bug in the cvsimport testsuite\n    - adds support for packed-refs to cvsserver\n    - adds basic support cvs co -c to cvsserver\n\n---\n git-cvsserver.perl              |   38 ++++++++++++++++++++++----------------\n t/t9400-git-cvsserver-server.sh |   25 +++++++++++++++++++++++++\n t/t9600-cvsimport.sh            |    1 +\n 3 files changed, 48 insertions(+), 16 deletions(-)\n"},{"id":"83665","messageId":"1216288877-12140-2-git-send-email-lars@public.noschinski.de","threadId":"14504","inReplyTo":"1216288877-12140-1-git-send-email-lars@public.noschinski.de","subject":"[PATCH] Testsuite: Unset CVS_SERVER","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2008-07-17T10:01:13Z","receivedAt":"2008-07-17T10:01:13Z","isPatch":true,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"From: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n\nThe CVS_SERVER environment variable cane cause some of the cvsimport tests\nto fail. So unset this variable at the beginning of the test script.\n\nSigned-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\nSigned-off-by: Lars Noschinski <lars@public.noschinski.de>\n---\n t/t9600-cvsimport.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 1e01e5c..0d7786a 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -5,6 +5,7 @@ test_description='git-cvsimport basic tests'\n \n CVSROOT=$(pwd)/cvsroot\n export CVSROOT\n+unset CVS_SERVER\n # for clean cvsps cache\n HOME=$(pwd)\n export HOME\n-- \n1.5.6.2\n"},{"id":"83663","messageId":"1216288877-12140-3-git-send-email-lars@public.noschinski.de","threadId":"14504","inReplyTo":"1216288877-12140-2-git-send-email-lars@public.noschinski.de","subject":"[PATCH] cvsserver: Add support for packed refs","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2008-07-17T10:01:14Z","receivedAt":"2008-07-17T10:01:14Z","isPatch":true,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"req_update still parses /refs/heads manually. Replace this by\na call to show-ref.\n\nSigned-off-by: Lars Noschinski <lars@public.noschinski.de>\n---\n git-cvsserver.perl |   25 +++++++++----------------\n 1 files changed, 9 insertions(+), 16 deletions(-)\n\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex b00d1c2..0e4f5f9 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -947,24 +947,17 @@ sub req_update\n     # projects (heads in this case) to checkout.\n     #\n     if ($state->{module} eq '') {\n-\tmy $heads_dir = $state->{CVSROOT} . '/refs/heads';\n-\tif (!opendir HEADS, $heads_dir) {\n-\t    print \"E [server aborted]: Failed to open directory, \"\n-\t      . \"$heads_dir: $!\\nerror\\n\";\n-\t    return 0;\n-\t}\n-        print \"E cvs update: Updating .\\n\";\n-\twhile (my $head = readdir(HEADS)) {\n-\t    if (-f $state->{CVSROOT} . '/refs/heads/' . $head) {\n-\t        print \"E cvs update: New directory `$head'\\n\";\n-\t    }\n-\t}\n-\tclosedir HEADS;\n-\tprint \"ok\\n\";\n-\treturn 1;\n+        my $showref = `git show-ref --heads`;\n+        for my $line (split '\\n', $showref) {\n+            if ( $line =~ m% refs/heads/(.*)$% ) {\n+                print \"M $1\\t$1\\n\";\n+            }\n+        }\n+        closedir HEADS;\n+        print \"ok\\n\";\n+        return 1;\n     }\n \n-\n     # Grab a handle to the SQLite db and do any necessary updates\n     my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log);\n \n-- \n1.5.6.2\n"},{"id":"83662","messageId":"1216288877-12140-4-git-send-email-lars@public.noschinski.de","threadId":"14504","inReplyTo":"1216288877-12140-3-git-send-email-lars@public.noschinski.de","subject":"[PATCH] cvsserver: Add testsuite for packed refs","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2008-07-17T10:01:15Z","receivedAt":"2008-07-17T10:01:15Z","isPatch":true,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"From: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n\nCheck that req_update shows refs, even if all refs are packed.\n\nSigned-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\nSigned-off-by: Lars Noschinski <lars@public.noschinski.de>\n---\n t/t9400-git-cvsserver-server.sh |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex e97aaa6..d181b5b 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -438,6 +438,20 @@ test_expect_success 'cvs update (-p)' '\n     test -z \"$(cat failures)\"\n '\n \n+cd \"$WORKDIR\"\n+cat > get_update_modules <<EOF\n+Root $SERVERDIR\n+Directory .\n+$SERVERDIR\n+update\n+EOF\n+\n+test_expect_success 'cvs update (module list supports packed refs)' '\n+    git pack-refs --all &&\n+    git cvsserver server < get_update_modules > out &&\n+    grep \"^M master[\t ]\\+master$\" < out\n+'\n+\n #------------\n # CVS STATUS\n #------------\n-- \n1.5.6.2\n"},{"id":"83661","messageId":"1216288877-12140-5-git-send-email-lars@public.noschinski.de","threadId":"14504","inReplyTo":"1216288877-12140-4-git-send-email-lars@public.noschinski.de","subject":"[PATCH] cvsserver: Add cvs co -c support","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2008-07-17T10:01:16Z","receivedAt":"2008-07-17T10:01:16Z","isPatch":true,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"Implement cvs checkout's -c option by returning a list of all \"modules\".\nThis is more useful than displaying a perl warning if -c is given.\n\nSigned-off-by: Lars Noschinski <lars@public.noschinski.de>\n---\n git-cvsserver.perl |   13 +++++++++++++\n 1 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 0e4f5f9..afd9789 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -801,6 +801,19 @@ sub req_co\n \n     argsplit(\"co\");\n \n+    # Provide list of modules, if -c was used.\n+    if (exists $state->{opt}{c}) {\n+        my $showref = `git show-ref --heads`;\n+        for my $line (split '\\n', $showref) {\n+            if ( $line =~ m% refs/heads/(.*)$% ) {\n+                print \"M $1\\t$1\\n\";\n+            }\n+        }\n+        closedir HEADS;\n+        print \"ok\\n\";\n+        return 1;\n+    }\n+\n     my $module = $state->{args}[0];\n     $state->{module} = $module;\n     my $checkout_path = $module;\n-- \n1.5.6.2\n"},{"id":"83660","messageId":"1216288877-12140-6-git-send-email-lars@public.noschinski.de","threadId":"14504","inReplyTo":"1216288877-12140-5-git-send-email-lars@public.noschinski.de","subject":"[PATCH] testsuite for cvs co -c","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2008-07-17T10:01:17Z","receivedAt":"2008-07-17T10:01:17Z","isPatch":true,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"From: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n\nCheck that all branches are displayed.\n\nSigned-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de>\nSigned-off-by: Lars Noschinski <lars@public.noschinski.de>\n---\n t/t9400-git-cvsserver-server.sh |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex d181b5b..3a59b9f 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -484,4 +484,15 @@ test_expect_success 'cvs status (no subdirs in header)' '\n     ! grep / <../out\n '\n \n+#------------\n+# CVS CHECKOUT\n+#------------\n+\n+cd \"$WORKDIR\"\n+test_expect_success 'cvs co -c (shows module database)' '\n+    GIT_CONFIG=\"$git_config\" cvs co -c > out &&\n+    grep \"^master[\t ]\\+master$\" < out &&\n+    ! grep -v \"^master[\t ]\\+master$\" < out\n+'\n+\n test_done\n-- \n1.5.6.2\n"},{"id":"83668","messageId":"alpine.LSU.1.00.0807171344210.3486@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"14504","inReplyTo":"1216288877-12140-2-git-send-email-lars@public.noschinski.de","subject":"Re: [PATCH] Testsuite: Unset CVS_SERVER","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-17T11:45:10Z","receivedAt":"2008-07-17T11:45:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jul 2008, Lars Noschinski wrote:\n\n> From: Fabian Emmes <fabian.emmes@rwth-aachen.de>\n> \n> The CVS_SERVER environment variable cane cause some of the cvsimport tests\n\ns/cane/can/\n\nOtherwise uncontroversial, I'd say.\n\nCiao,\nDscho\n"},{"id":"83669","messageId":"alpine.LSU.1.00.0807171346560.3486@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"14504","inReplyTo":"1216288877-12140-3-git-send-email-lars@public.noschinski.de","subject":"Re: [PATCH] cvsserver: Add support for packed refs","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-17T11:50:37Z","receivedAt":"2008-07-17T11:50:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jul 2008, Lars Noschinski wrote:\n\n> req_update still parses /refs/heads manually. Replace this by\n> a call to show-ref.\n> \n> Signed-off-by: Lars Noschinski <lars@public.noschinski.de>\n> ---\n>  git-cvsserver.perl |   25 +++++++++----------------\n>  1 files changed, 9 insertions(+), 16 deletions(-)\n> \n> diff --git a/git-cvsserver.perl b/git-cvsserver.perl\n> index b00d1c2..0e4f5f9 100755\n> --- a/git-cvsserver.perl\n> +++ b/git-cvsserver.perl\n> @@ -947,24 +947,17 @@ sub req_update\n>      # projects (heads in this case) to checkout.\n>      #\n>      if ($state->{module} eq '') {\n> -\tmy $heads_dir = $state->{CVSROOT} . '/refs/heads';\n> -\tif (!opendir HEADS, $heads_dir) {\n> -\t    print \"E [server aborted]: Failed to open directory, \"\n> -\t      . \"$heads_dir: $!\\nerror\\n\";\n> -\t    return 0;\n> -\t}\n> -        print \"E cvs update: Updating .\\n\";\n> -\twhile (my $head = readdir(HEADS)) {\n> -\t    if (-f $state->{CVSROOT} . '/refs/heads/' . $head) {\n> -\t        print \"E cvs update: New directory `$head'\\n\";\n> -\t    }\n> -\t}\n> -\tclosedir HEADS;\n> -\tprint \"ok\\n\";\n> -\treturn 1;\n> +        my $showref = `git show-ref --heads`;\n> +        for my $line (split '\\n', $showref) {\n> +            if ( $line =~ m% refs/heads/(.*)$% ) {\n> +                print \"M $1\\t$1\\n\";\n\nIn the removed part, I see that this changes behaviour from \"E cvs update: \n...\" to \"M ...\".\n\nI do not know the CVS protocol well enough to know if that is still \ncorrect.\n\nBTW from the removed part, it seems that the indentation was done with \ntabs formerly, and with spaces now; please use tabs instead.\n\nThanks,\nDscho\n"},{"id":"83670","messageId":"alpine.LSU.1.00.0807171351520.3486@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"14504","inReplyTo":"1216288877-12140-4-git-send-email-lars@public.noschinski.de","subject":"Re: [PATCH] cvsserver: Add testsuite for packed refs","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-17T11:54:28Z","receivedAt":"2008-07-17T11:54:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jul 2008, Lars Noschinski wrote:\n\n> +    grep \"^M master[\t ]\\+master$\" < out\n\nAs I said, I am not versed enough in the Teachings of CVS to know if this \nis correct.\n\nIf the old behaviour (\"E cvs ...\") was \"more\" correct, this needs \nchanging, too.\n\nCiao,\nDscho\n"},{"id":"83679","messageId":"20080717124034.GA10589@lars.home.noschinski.de","threadId":"14504","inReplyTo":"alpine.LSU.1.00.0807171346560.3486@wbgn129.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] cvsserver: Add support for packed refs","fromName":"Lars Noschinski","fromEmail":"lars@public.noschinski.de","sentAt":"2008-07-17T12:40:35Z","receivedAt":"2008-07-17T12:40:35Z","isPatch":true,"sender":{"key":"lars@public.noschinski.de","avatar":"https://gravatar.com/avatar/ca62bd8b265f2e26c89d39a4bfe7e390bfa6b16d6400e186e222d1c2382c66f2?d=mp&s=160"},"body":"Hello!\n\n* Johannes Schindelin <Johannes.Schindelin@gmx.de> [08-07-17 14:31]:\n>On Thu, 17 Jul 2008, Lars Noschinski wrote:\n>\n>> req_update still parses /refs/heads manually. Replace this by\n>> a call to show-ref.\n>> \n>> Signed-off-by: Lars Noschinski <lars@public.noschinski.de>\n>> ---\n>>  git-cvsserver.perl |   25 +++++++++----------------\n>>  1 files changed, 9 insertions(+), 16 deletions(-)\n>> \n>> diff --git a/git-cvsserver.perl b/git-cvsserver.perl\n>> index b00d1c2..0e4f5f9 100755\n>> --- a/git-cvsserver.perl\n>> +++ b/git-cvsserver.perl\n>> @@ -947,24 +947,17 @@ sub req_update\n>>      # projects (heads in this case) to checkout.\n>>      #\n>>      if ($state->{module} eq '') {\n>> -\tmy $heads_dir = $state->{CVSROOT} . '/refs/heads';\n>> -\tif (!opendir HEADS, $heads_dir) {\n>> -\t    print \"E [server aborted]: Failed to open directory, \"\n>> -\t      . \"$heads_dir: $!\\nerror\\n\";\n>> -\t    return 0;\n>> -\t}\n>> -        print \"E cvs update: Updating .\\n\";\n>> -\twhile (my $head = readdir(HEADS)) {\n>> -\t    if (-f $state->{CVSROOT} . '/refs/heads/' . $head) {\n>> -\t        print \"E cvs update: New directory `$head'\\n\";\n>> -\t    }\n>> -\t}\n>> -\tclosedir HEADS;\n>> -\tprint \"ok\\n\";\n>> -\treturn 1;\n>> +        my $showref = `git show-ref --heads`;\n>> +        for my $line (split '\\n', $showref) {\n>> +            if ( $line =~ m% refs/heads/(.*)$% ) {\n>> +                print \"M $1\\t$1\\n\";\n>\n>In the removed part, I see that this changes behaviour from \"E cvs update: \n>...\" to \"M ...\".\n\nGood catch, this part is indeed somewhat busted. The tested clients did\nnot care, but this should be changed nevertheless to be the same as the\nold behaviour.\n\n>I do not know the CVS protocol well enough to know if that is still \n>correct.\n>\n>BTW from the removed part, it seems that the indentation was done with \n>tabs formerly, and with spaces now; please use tabs instead.\n\nActually, the old indetation was wrong. The biggest part of the file\n(and the surrounding code) is indented by spaces.\n"},{"id":"83729","messageId":"20080717175303.GA8197@sigill.intra.peff.net","threadId":"14504","inReplyTo":"1216288877-12140-2-git-send-email-lars@public.noschinski.de","subject":"Re: [PATCH] Testsuite: Unset CVS_SERVER","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-07-17T17:53:03Z","receivedAt":"2008-07-17T17:53:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jul 17, 2008 at 12:01:13PM +0200, Lars Noschinski wrote:\n\n> The CVS_SERVER environment variable cane cause some of the cvsimport tests\n> to fail. So unset this variable at the beginning of the test script.\n\nThis is definitely an improvement. However, the cvs manual lists a\nnumber of CVS* variables. Perhaps it would be better to simply scrub the\nenvironment of any variable matching that pattern? I don't know how\ncommonly used some of the other ones are.\n\n-Peff\n"}]}