Re: [PATCH RFC 1/2] gitweb: Fix warnings with override permitted but no repo override
- From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- Date
- Feb 18, 2009, 07:41 UTC
- Message-ID
- <cb7bb73a0902172341x2265e9d4r24a16ef2913bcda6@mail.gmail.com>
- In-Reply-To
- <1234926043-7471-1-git-send-email-marcel@oak.homeunix.org>
On Wed, Feb 18, 2009 at 4:00 AM, Marcel M. Cary <marcel@oak.homeunix.org> wrote:
Show 16 quoted lines
> When a feature like "blame" is permitted to be overridden in the > repository configuration but it is not actually set in the > repository, a warning is emitted due to the undefined value > of the repository configuration, even though it's a perfectly > normal condition. > > The warning is grounds for test failure in the gitweb test script, > so it causes some new feature tests of mine to fail. > > This patch prevents warning and adds a test case to exercise it. > > Signed-off-by: Marcel M. Cary <marcel@oak.homeunix.org> > --- > > Here's a small patch I put together while tinkering with bug hyperlinking. > Does this look reasonable?
My only perplexity is about this:
Show 6 quoted lines
> @@ -1978,6 +1978,8 @@ sub git_get_project_config {
> $config_file = "$git_dir/config";
> }
>
> + return undef if (!defined $config{"gitweb.$key"});
> +I'm no Perl expert, so I have no idea: how do non-bool config checks (which expect arrays) cope with an undef? Also, you may want to add a non-bool override test in the test suite.
-- Giuseppe "Oblomov" Bilotta