From: Junio C Hamano <gitster@pobox.com>
To: "John 'Warthog9' Hawley" <warthog9@eaglescrag.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] gitweb: Add an option to force version match
Date: Tue, 02 Feb 2010 14:59:17 -0800 [thread overview]
Message-ID: <7vvdef1by2.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1265147814-13284-2-git-send-email-warthog9@eaglescrag.net> (John Hawley's message of "Tue\, 2 Feb 2010 13\:56\:53 -0800")
"John 'Warthog9' Hawley" <warthog9@eaglescrag.net> writes:
John, I'm sorry but I have to say this is somewhat incoherent.
> + * $git_versions_must_match
> + If set to true value, gitweb fails with "500 Internal Server Error" error
> + if the version of the gitweb doesn't match version of the git binary.
> + Gitweb can usually run with a mismatched git install. The default is 1
> + (true).
I would understand that it if this were "Gitweb seldom runs correctly with
unmatched version of git, so this defaults to true". If it can _usually_
run just fine, why should everybody need to flip this off? This doesn't
make any sense to me.
> @@ -583,6 +586,33 @@ sub get_loadavg {
> our $git_version = qx("$GIT" --version) =~ m/git version (.*)$/ ? $1 : "unknown";
> $number_of_git_cmds++;
>
> +# Throw an error if git versions does not match, if $git_versions_must_match is true.
> +if ($git_versions_must_match &&
> + $git_version ne $version) {
> + my $admin_contact =
> + defined $ENV{'SERVER_ADMIN'} ? ", $ENV{'SERVER_ADMIN'}," : '';
> + my $err_msg = <<EOT;
> +<h1 align="center">*** Warning ***</h1>
> +<p>
> +This version of gitweb was compiled for <b>@{[esc_html($version)]}</b>,
> +however git version <b>@{[esc_html($git_version)]}</b> was found on server.
> +Running an instance of gitweb that is not matched to the git binaries may
> +result in unexpected behavior of gitweb, and loss of functionality or
> +incorrect data on displayed pages.
> +</p>
> +<p>
> +Please update the git or gitweb installation so that their versions match, or
> +if you feel you are sure that you wish to proceed with running gitweb
> +with unmatched versions please contact the server administrator${admin_contact}
> +to configure gitweb to allow mismatched versions. This can be done by
> +setting \$git_versions_must_match to @{[esc_html($git_versions_must_match)]}
> +(false value) in gitweb configuration file,
> +'@{[esc_path(-e $GITWEB_CONFIG ? $GITWEB_CONFIG : $GITWEB_CONFIG_SYSTEM)]}'.
> +</p>
> +EOT
> + die_error(500, 'Internal server error', $err_msg);
Why, why, why?
This is not even a "*** Warning ***". You are refusing to let them do
anything useful until they either flip the bit off or reinstall git and/or
gitweb. It is a _fatal error_ message.
To whom are you giving this _warning_? Please read the message yourself
again.
The message tells _you_ to consider using matching versions (as if _you_
have the choice and authority to do so), hints _you_ to decide if you are
Ok with running an unmatched combination (again, as if _you_ have the
authority to make that decision), and then instructs _you_ to contact the
server administrator (who presumably can flip the bit).
That doesn't make _any_ sense to me. Hopefully anybody who installs or
upgrades gitweb/git will hit his gitweb installation at least once before
end users start hitting, so I would understand it if you wrote the above
message addressed to the server administrator.
If somebody updates his git without bothering to update gitweb, on the
other hand, the end user may see the message before the administrator
does. If git and gitweb might be managed by different people at a
particular site (k.org?), I would understand that the administrator of the
gitweb side _might_ want to be told about it by the end user, and the
above might be an attempt to make that happen.
But even in that case, out of the three instructions, only the last one is
for the end user, and telling him to be certain the combinations do work
before bugging the gitweb administrator doesn't make much sense to me.
So I have to ask a basic question I asked (at least I tried to) last night
again. Whom are you trying to help?
Even if it is to help a gitweb administrator who is not in charge of other
people in the administrator group who would install unmatching versions of
git without telling him, would this really be the best solution? You'd be
the first to suffer from this when HPA or whoever installs a new version
of git at k.org. There should be a better way to help communication
between the people in the administration group, without involving or
inconveniencing the end users like this patch seems to do.
next prev parent reply other threads:[~2010-02-02 22:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-02 21:56 [PATCH 0/2] gitweb misc fixes mkII John 'Warthog9' Hawley
2010-02-02 21:56 ` [PATCH 1/2] gitweb: Add an option to force version match John 'Warthog9' Hawley
2010-02-02 21:56 ` [PATCH 2/2] gitweb: Fix chop_str to allow for & characters in strings John 'Warthog9' Hawley
2010-02-02 23:43 ` Jakub Narebski
2010-02-02 23:54 ` J.H.
2010-02-03 11:28 ` [PATCH] gitweb: Simplify (and fix) chop_str Jakub Narebski
2010-02-03 18:25 ` J.H.
2010-02-02 22:59 ` Junio C Hamano [this message]
2010-02-02 23:56 ` [PATCH 1/2] gitweb: Add an option to force version match Jakub Narebski
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=7vvdef1by2.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=warthog9@eaglescrag.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).