From: Krzesimir Nowak <krzesimir@endocode.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Git List" <git@vger.kernel.org>,
"Junio C Hamano" <gitster@pobox.com>,
"Jakub Narębski" <jnareb@gmail.com>
Subject: Re: [PATCH v3] gitweb: Add an option for adding more branch refs
Date: Mon, 02 Dec 2013 11:13:19 +0100 [thread overview]
Message-ID: <1385979199.2054.2.camel@localhost.localdomain> (raw)
In-Reply-To: <CAPig+cSjzpSatp9EhpwA9b_XScAPUpkMxmPo70qJCxxakMwq3Q@mail.gmail.com>
On Thu, 2013-11-28 at 20:13 -0500, Eric Sunshine wrote:
> On Thu, Nov 28, 2013 at 6:44 AM, Krzesimir Nowak <krzesimir@endocode.com> wrote:
> > Allow @additional_branch_refs configuration variable to tell gitweb to
> > show refs from additional hierarchies in addition to branches in the
> > list-of-branches view.
> >
> > Signed-off-by: Krzesimir Nowak <krzesimir@endocode.com>
> > ---
> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> > index 68c77f6..25e1d37 100755
> > --- a/gitweb/gitweb.perl
> > +++ b/gitweb/gitweb.perl
> > @@ -680,6 +688,19 @@ sub read_config_file {
> > return;
> > }
> >
> > +# performs sanity checks on parts of configuration.
> > +sub config_sanity_check {
> > + # check additional refs validity
> > + my %unique_branch_refs = ();
> > + for my $ref (@additional_branch_refs) {
> > + die_error(500, "Invalid ref '$ref' in \@additional_branch_refs") unless (validate_ref($ref));
> > + # 'heads' are added implicitly in get_branch_refs().
> > + $unique_branch_refs{$ref} = 1 if ($ref ne 'heads');
> > + }
> > + @additional_branch_refs = sort keys %unique_branch_refs;
> > + %unique_branch_refs = undef;
> > +}
>
> %unique_branch_refs is going out of scope here, so clearing it seems
> unnecessary.
I am cleaning it in case when more sanity checking code gets added. So
there is no need to keep the data further.
>
> Moreover, with warnings enabled, perl should be complaining about an
> "Odd number of elements in hash assignment". (Normally, you would
> clear a hash with '%foo=()' or 'undef %foo'.)
>
Gah, ok. I'll fix it. Thanks.
> > +
> > our ($GITWEB_CONFIG, $GITWEB_CONFIG_SYSTEM, $GITWEB_CONFIG_COMMON);
> > sub evaluate_gitweb_config {
> > our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
--
Krzesimir Nowak
Software Developer
Endocode AG
krzesimir@endocode.com
------
Endocode AG, Johannisstraße 20, 10117 Berlin
info@endocode.com | www.endocode.com
Vorstandsvorsitzender: Mirko Boehm
Vorstände: Dr. Karl Beecher, Chris Kühl, Sebastian Sucker
Aufsichtsratsvorsitzende: Jennifer Beecher
Registergericht: Amtsgericht Charlottenburg - HRB 150748 B
next prev parent reply other threads:[~2013-12-02 10:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-28 11:44 [PATCH v3] gitweb: Add an option for adding more branch refs Krzesimir Nowak
2013-11-29 1:13 ` Eric Sunshine
2013-12-02 10:13 ` Krzesimir Nowak [this message]
2013-12-02 0:21 ` Jakub Narębski
2013-12-02 12:06 ` Krzesimir Nowak
2013-12-02 17:34 ` Jakub Narębski
2013-12-03 10:53 ` Krzesimir Nowak
2013-12-03 13:02 ` Jakub Narębski
2013-12-03 14:58 ` Krzesimir Nowak
2013-12-02 18:18 ` Junio C Hamano
2013-12-02 18:25 ` Jakub Narębski
2013-12-02 21:09 ` Junio C Hamano
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=1385979199.2054.2.camel@localhost.localdomain \
--to=krzesimir@endocode.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
--cc=sunshine@sunshineco.com \
/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).