git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t9400: Use the repository config and nothing else.
@ 2007-05-11 23:35 Junio Hamano
  2007-05-12 16:28 ` Frank Lichtenheld
  2007-05-12 19:30 ` [PATCH] cvsserver: Complete rewrite of the configuration parser Frank Lichtenheld
  0 siblings, 2 replies; 11+ messages in thread
From: Junio Hamano @ 2007-05-11 23:35 UTC (permalink / raw)
  To: junkio; +Cc: git

git-cvsserver has a bug in its configuration file output parser
that makes it choke if the configuration has these:

        [diff]
                color = auto
        [diff.color]
                whitespace = blue reverse

This needs to be fixed, but thanks to that bug, a separate bug
in t9400 test script was discovered.  The test discarded
GIT_CONFIG instead of pointing at the proper one to be used in
the exoprted repository.  This allowed user's .gitconfig and (if
exists) systemwide /etc/gitconfig to affect the outcome of the
test, which is a big no-no.

The patch fixes the problem in the test.  Fixing the
git-cvsserver's configuration parser is left as an exercise to
motivated volunteers ;-)

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 * I think the fix to git-cvsserver should be straightforward.
   Instead of parsing two or three level names in a hierarchical
   hash around ll.187-192 for *all* config items, it should just
   parse gitcvs related ones only, as that are the only ones
   that the script cares about.

 t/t9400-git-cvsserver-server.sh |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index f137b30..b136a97 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -26,6 +26,7 @@ perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
 unset GIT_DIR GIT_CONFIG
 WORKDIR=$(pwd)
 SERVERDIR=$(pwd)/gitcvs.git
+git_config=$SERVERDIR/config
 CVSROOT=":fork:$SERVERDIR"
 CVSWORK=$(pwd)/cvswork
 CVS_SERVER=git-cvsserver
@@ -43,7 +44,7 @@ echo >empty &&
 # note that cvs doesn't accept absolute pathnames
 # as argument to co -d
 test_expect_success 'basic checkout' \
-  'cvs -Q co -d cvswork master &&
+  'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
    test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5))" = "empty/1.1/"'
 
 test_expect_success 'cvs update (create new file)' \
@@ -52,7 +53,7 @@ test_expect_success 'cvs update (create new file)' \
    git commit -q -m "Add testfile1" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
-   cvs -Q update &&
+   GIT_CONFIG="$git_config" cvs -Q update &&
    test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.1/" &&
    diff -q testfile1 ../testfile1'
 
@@ -63,7 +64,7 @@ test_expect_success 'cvs update (update existing file)' \
    git commit -q -m "Append to testfile1" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
-   cvs -Q update &&
+   GIT_CONFIG="$git_config" cvs -Q update &&
    test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.2/" &&
    diff -q testfile1 ../testfile1'
 
@@ -76,7 +77,7 @@ test_expect_failure "cvs update w/o -d doesn't create subdir (TODO)" \
    git commit -q -m "Single Subdirectory" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
-   cvs -Q update &&
+   GIT_CONFIG="$git_config" cvs -Q update &&
    test ! -d test'
 
 cd "$WORKDIR"
@@ -89,7 +90,7 @@ test_expect_success 'cvs update (subdirectories)' \
    git commit -q -m "deep sub directory structure" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
-   cvs -Q update -d &&
+   GIT_CONFIG="$git_config" cvs -Q update -d &&
    (for dir in A A/B A/B/C A/D E; do
       filename="file_in_$(echo $dir|sed -e "s#/# #g")" &&
       if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" &&
@@ -107,7 +108,7 @@ test_expect_success 'cvs update (delete file)' \
    git commit -q -m "Remove testfile1" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
-   cvs -Q update &&
+   GIT_CONFIG="$git_config" cvs -Q update &&
    test -z "$(grep testfile1 CVS/Entries)" &&
    test ! -f testfile1'
 
@@ -118,7 +119,7 @@ test_expect_success 'cvs update (re-add deleted file)' \
    git commit -q -m "Re-Add testfile1" &&
    git push gitcvs.git >/dev/null &&
    cd cvswork &&
-   cvs -Q update &&
+   GIT_CONFIG="$git_config" cvs -Q update &&
    test "$(echo $(grep testfile1 CVS/Entries|cut -d/ -f2,3,5))" = "testfile1/1.4/" &&
    diff -q testfile1 ../testfile1'
 

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-05-13 19:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-11 23:35 [PATCH] t9400: Use the repository config and nothing else Junio Hamano
2007-05-12 16:28 ` Frank Lichtenheld
2007-05-12 16:31   ` Junio C Hamano
2007-05-12 17:21     ` Junio C Hamano
2007-05-12 19:36       ` Frank Lichtenheld
2007-05-12 19:30 ` [PATCH] cvsserver: Complete rewrite of the configuration parser Frank Lichtenheld
2007-05-12 19:59   ` Junio C Hamano
2007-05-12 21:31     ` Frank Lichtenheld
2007-05-12 22:43       ` Junio C Hamano
2007-05-13  0:16         ` [PATCH] cvsserver: Limit config parser to needed options Frank Lichtenheld
2007-05-13 19:16           ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).