From: Jakub Narebski <jnareb@gmail.com>
To: Eli Barzilay <eli@barzilay.org>
Cc: git@vger.kernel.org
Subject: Re: gitweb problem?
Date: Mon, 01 Mar 2010 02:24:13 -0800 (PST) [thread overview]
Message-ID: <m3bpf8mj5k.fsf@localhost.localdomain> (raw)
In-Reply-To: <m34ol0wmze.fsf@winooski.ccs.neu.edu>
Eli Barzilay <eli@barzilay.org> writes:
> Whenever I view the toplevel gitweb page (running as a cgi script
> under apache), but not when in a specific repo, I get this in my error
> log:
>
> gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at /home/git/gitweb/gitweb.cgi line 2065.
> fatal: error processing config file(s)
> gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at /home/git/gitweb/gitweb.cgi line 2221.
> gitweb.cgi: Use of uninitialized value $git_dir in concatenation (.) or string at /home/git/gitweb/gitweb.cgi line 2218.
>
> (taken verbatim from the apache error log, removed uninteresting line
> prefixes.)
In the future (or if my diagnosis would turn out to be incorrect)
could you please show which lines are those (in *your* gitweb.cgi),
or at least provide gitweb version? Changes to gitweb can render
such line numbers invalid.
> I'm using the pathinfo option, so perhaps there is a problem with that
> setup?
In the future (or if my diagnosis would turn out to be incorrect) could
you please include relevant parts of $GITWEB_CONFIG (by default it is
gitweb_config.perl), at least which features you have enabled, and how
they are configured?
>
> Looking at the source, the last two line numbers are in
> `git_get_project_config' -- so my guess is that the code is trying to
> get the options from the repository config file even when showing the
> toplevel page. Based on this, and also guessing that $git_dir is
> unset when viewing the toplevel page, I added
>
> return unless (defined $git_dir);
>
> to the top (of the `git_get_project_config' function), and I get no
> warnings and everything works as it should.
>
> (Disclaimer: I can barely read perl, and I'm a git newbie, so all of
> this can be due to some other stupid mistake.)
That looks like lack of hardening against pilot error. The
git_get_project_config should never be run when $git_dir is not set, as it
is meant to access *project* config.
But at the top of git_project_list_body subroutine, which is responsible for
generating toplevel page with list of projects, we have:
my $check_forks = gitweb_check_feature('forks');
and a bit later
my $show_ctags = gitweb_check_feature('ctags');
Now both of those features are marked as not supporting project specific
override. It might be that you by accident set $feature{XXX}{'override'}
to true... but I might be mistaken.
It would be strange that this bug was not detected by t9500 test...
--
Jakub Narebski
Poland
ShadeHawk on #git
next prev parent reply other threads:[~2010-03-01 10:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-01 6:54 gitweb problem? Eli Barzilay
2010-03-01 10:24 ` Jakub Narebski [this message]
2010-03-01 11:51 ` Eli Barzilay
2010-03-01 13:40 ` Jakub Narebski
2010-03-01 21:51 ` [PATCH] gitweb: Fix project-specific feature override behavior Jakub Narebski
2010-03-02 4:40 ` gitweb problem? Eli Barzilay
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=m3bpf8mj5k.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=eli@barzilay.org \
--cc=git@vger.kernel.org \
/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).