From: Ramsay Jones <ramsay@ramsay1•demon.co.uk>
To: Junio C Hamano <gitster@pobox•com>
Cc: git@vger•kernel.org
Subject: Re: What's cooking in git.git (Dec 2010, #05; Thu, 16)
Date: Sat, 18 Dec 2010 22:00:26 +0000 [thread overview]
Message-ID: <4D0D2EFA.7060106@ramsay1.demon.co.uk> (raw)
In-Reply-To: <7vk4j8kfwy.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
>
> --------------------------------------------------
> [New Topics]
>
> * rj/maint-difftool-cygwin-workaround (2010-12-14) 1 commit
> - difftool: Fix failure on Cygwin
>
> * rj/maint-test-fixes (2010-12-14) 5 commits
> - t9501-*.sh: Fix a test failure on Cygwin
> - lib-git-svn.sh: Add check for mis-configured web server variables
This lib-git-svn.sh patch (above) has a quite serious fault :(
I'm very annoyed with myself, because I was trying so hard to be
conservative and safe! :-P
The original branch containing these lib-git-svn.sh patches (#3-5 in the
original series) had another commit with the highly informative commit
message: WIP. I could not remember what this commit was about, or if it
was complete (but I thought not), so I didn't send it along with the
others ... Well, this evening I remembered what it was about, along
with the fact that it fixed a problem with the above and that I had
intended to squash all of these patches into one.
The problem with the above is this: because lib-git-svn.sh is sourced
by 57 test files, only four of which even remotely care about using
apache, if SVN_HTTPD_PORT is set and your apache install cannot be
found, then *all* 57 tests will be skipped.
Sorry about that ...
I've added a diff of the additional commit below (well, I changed a
couple of "test ! -e" to "test ! -f", given your comment on patch
04/14) so you can see that the fix will involve moving the code used
to check your apache installation into a separate function which will
only be called from start_httpd; ie only tests that want to use the
web-server will execute this code.
I'll send a proper patch soon. Again, I must apologize for messing up!
ATB,
Ramsay Jones
--- >8 ---
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index 5acc0ec..d48fe6b 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -68,8 +68,7 @@ svn_cmd () {
svn "$orig_svncmd" --config-dir "$svnconf" "$@"
}
-if test -n "$SVN_HTTPD_PORT"
-then
+prepare_httpd () {
for d in \
"$SVN_HTTPD_PATH" \
/usr/sbin/apache2 \
@@ -83,8 +82,8 @@ then
done
if test -z "$SVN_HTTPD_PATH"
then
- skip_all='skipping git svn tests, Apache not found'
- test_done
+ echo >&2 'Apache not found'
+ return 1
fi
for d in \
"$SVN_HTTPD_MODULE_PATH" \
@@ -99,10 +98,15 @@ then
done
if test -z "$SVN_HTTPD_MODULE_PATH"
then
- skip_all='skipping git svn tests, Apache module dir not found'
- test_done
+ echo >&2 'Apache module dir not found'
+ return 1
fi
-fi
+ if test ! -f "$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so"
+ then
+ echo >&2 'Apache module "mod_dav_svn.so" not found'
+ return 1
+ fi
+}
start_httpd () {
repo_base_path="$1"
@@ -111,11 +115,9 @@ start_httpd () {
echo >&2 'SVN_HTTPD_PORT is not defined!'
return
fi
- if test ! -e "$SVN_HTTPD_MODULE_PATH/mod_dav_svn.so"
- then
- echo >&2 'Apache module "mod_dav_svn.so" not found'
- return 1
- fi
+
+ prepare_httpd || return 1
+
if test -z "$repo_base_path"
then
repo_base_path=svn
@@ -143,7 +145,7 @@ EOF
stop_httpd () {
test -z "$SVN_HTTPD_PORT" && return
- test ! -e "$GIT_DIR/httpd.conf" && return
+ test ! -f "$GIT_DIR/httpd.conf" && return
"$SVN_HTTPD_PATH" -f "$GIT_DIR"/httpd.conf -k stop
}
--- 8< ---
prev parent reply other threads:[~2010-12-18 22:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-17 7:38 What's cooking in git.git (Dec 2010, #05; Thu, 16) Junio C Hamano
2010-12-17 11:18 ` conflict resolution of pd/bash-4-completion [Re: What's cooking in git.git (Dec 2010, #05; Thu, 16)] SZEDER Gábor
2010-12-17 19:24 ` Junio C Hamano
2010-12-18 22:00 ` Ramsay Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D0D2EFA.7060106@ramsay1.demon.co.uk \
--to=ramsay@ramsay1$(echo .)demon.co.uk \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox