git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] t9400: Add test cases for config file handling

From
Junio C Hamano <junkio@cox.net>
Date
May 21, 2007, 00:57 UTC
Message-ID
<7vlkfjhu2w.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<11797003182642-git-send-email-frank@lichtenheld.de>
This part seems to fail for me and gets an "unexpected cvs success".
+rm -fr cvswork2
+test_expect_success 'gitcvs.ext.enabled = false' \
+  'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false &&
+   GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
+   if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1
+   then
+     echo unexpected cvs success
+     false
+   else
+     true
+   fi &&
+   cat cvs.log | grep -q "GITCVS emulation disabled" &&
+   test ! -d cvswork2'
+
I think the per-method enablement logic is not quite right.

-- >8 -- git-cvsserver: ignore global config when per-method config disables an access.

When the per-method enable logic disables the access, we should not even look at the global one.

 git-cvsserver.perl |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index fcfb99d..1de5177 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -192,11 +192,9 @@ sub req_Root
         }
     }
 
-    unless ( ($cfg->{gitcvs}{$state->{method}}{enabled}
-	      and $cfg->{gitcvs}{$state->{method}}{enabled} =~ /^\s*(1|true|yes)\s*$/i)
-	     or ($cfg->{gitcvs}{enabled}
-	      and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i) )
-    {
+    my $enabled = ($cfg->{gitcvs}{$state->{method}}{enabled}
+		   || $cfg->{gitcvs}{enabled});
+    unless ($enabled && $enabled =~ /^\s*(1|true|yes)\s*$/i) {
         print "E GITCVS emulation needs to be enabled on this repo\n";
         print "E the repo config file needs a [gitcvs] section added, and the parameter 'enabled' set to 1\n";
         print "E \n";
Previous: Frank LichtenheldNext: Frank Lichtenheld
Message 4 of 7 in “t9400: Add test cases for config file handling”
  1. 1/3 t9400: Add test cases for config file handlingFrank Lichtenheld, May 20, 2007
  2. 2/3 t9400: Add some more cvs update testsFrank Lichtenheld, May 20, 2007
  3. 3/3 t9400: Add some basic pserver testsFrank Lichtenheld, May 20, 2007
  4. Junio C HamanoMay 21, 2007
  5. Frank LichtenheldMay 21, 2007
  6. Junio C HamanoMay 21, 2007
  7. Frank LichtenheldMay 21, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.