From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "John 'Warthog9' Hawley" <warthog9@eaglescrag.net>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] gitweb: Add an option to force version match
Date: Tue, 02 Feb 2010 15:56:36 -0800 (PST) [thread overview]
Message-ID: <m3iqaf9oqu.fsf@localhost.localdomain> (raw)
In-Reply-To: <7vvdef1by2.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> "John 'Warthog9' Hawley" <warthog9@eaglescrag.net> writes:
> > @@ -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)]}
Errr... the above line does not makes sense, as $git_versions_must_match
is true (true value), and not false (false value). so you would get something
like:
'setting $git_versions_must_match to 1 (false value) [...]'
> > +(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);
As I wrote in my earlier response, this is not enough. If this error
message (description of this situation) is meant to describe how to turn
this feature off, it has to deal with situation where config file does
not exist. With this feature off by default we knew that it had to be
changed in some gitweb config file, so one of $GITWEB_CONFIG and
$GITWEB_CONFIG_SYSTEM must exists. This is not true if this feature is
turned on by default.
You need to describe how to deal with the following situations:
* Both $GITWEB_CONFIG and $GITWEB_CONFIG_SYSTEM are empty or undefined.
You might skip this situation, as by default both are set by
gitweb/Makefile, $GITWEB_CONFIG to gitweb_config.perl and
$GITWEB_CONFIG_SYSTEM to /etc/gitweb.conf
* Both $GITWEB_CONFIG and $GITWEB_CONFIG_SYSTEM are set and non-empty,
but neither file exists (this means that $projects_list is set during
build stage).
Current code deals correctly only with situation where either
$GITWEB_CONFIG or $GITWEB_CONFIG_SYSTEM exists, and it further assumes
that neither is undefined (you would get perl errors in case if either
is undefined).
> 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.
Ooops.
>
> To whom are you giving this _warning_? Please read the message yourself
> again.
The original message (from "Gitweb caching v2" thread) was ment purely
for server administrator. Current version tries to address both
ordinary user (which has to contact gitweb administrator) and gitweb
administrator (who needs to know how to remote error condition, either
by bringing git and gitweb versions in sync, or by changing
configuration). And does it badly...
[...]
> So I have to ask a basic question I asked (at least I tried to) last night
> again. Whom are you trying to help?
[...]
--
Jakub Narebski
Poland
ShadeHawk on #git
prev parent reply other threads:[~2010-02-02 23:56 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 ` [PATCH 1/2] gitweb: Add an option to force version match Junio C Hamano
2010-02-02 23:56 ` Jakub Narebski [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=m3iqaf9oqu.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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).