From: Krzesimir Nowak <krzesimir@endocode.com>
To: "Jakub Narębski" <jnareb@gmail.com>
Cc: git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>,
Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH 4/5] gitweb: Add a feature for adding more branch refs
Date: Thu, 05 Dec 2013 11:00:35 +0100 [thread overview]
Message-ID: <1386237635.2186.22.camel@localhost.localdomain> (raw)
In-Reply-To: <CANQwDwe+a2P0Jxqw0k7sHWv3exdb4k+NU3jL3ogR-rcetd82TQ@mail.gmail.com>
On Wed, 2013-12-04 at 19:06 +0100, Jakub Narębski wrote:
> On Wed, Dec 4, 2013 at 2:43 PM, Krzesimir Nowak <krzesimir@endocode.com> wrote:
> >
> > Allow extra-branch-refs feature 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>
> > Reviewed-by: Junio C Hamano <gitster@pobox.com>
> > Reviewed-by: Jakub Narębski <jnareb@gmail.com>
>
> This version is Helped-by (maybe), but not (yet!) Reviewed-by.
>
> > ---
> > Documentation/gitweb.conf.txt | 37 +++++++++++++++++++
> > gitweb/gitweb.perl | 85 +++++++++++++++++++++++++++++++++++++------
> > 2 files changed, 110 insertions(+), 12 deletions(-)
> >
> > diff --git a/Documentation/gitweb.conf.txt b/Documentation/gitweb.conf.txt
> > index e2113d9..5a77452 100644
> > --- a/Documentation/gitweb.conf.txt
> > +++ b/Documentation/gitweb.conf.txt
> > @@ -849,6 +849,43 @@ time zones in the form of "+/-HHMM", such as "+0200".
> > +
> > Project specific override is not supported.
> >
> > +extra-branch-refs::
> > + List of additional directories under "refs" which are going to
> > + be used as branch refs. For example if you have a gerrit setup
> > + where all branches under refs/heads/ are official,
> > + push-after-review ones and branches under refs/sandbox/,
> > + refs/wip and refs/other are user ones where permissions are
> > + much wider, then you might want to set this variable as
> > + follows:
> > ++
> > +--------------------------------------------------------------------------------
> > +$feature{'extra-branch-refs'}{'default'} =
> > + ['sandbox', 'wip', 'other'];
> > +--------------------------------------------------------------------------------
> > ++
> > +If overriding was enabled then this feature can be configured on a
>
> s/was/is/;
>
> Perhaps it would better read as
>
> This feature can be configured on per-repository basis after setting
> $feature{'extra-branch-refs'}{'override'} to true, via repository's
> `gitweb.extraBranchRefs` ...
I see that you also insist on using camelCase for config variables. I
will rephrase it.
>
> > +per-repository basis via repository's `gitweb.extrabranchrefs`
> > +configuration variable, which contains a space separated list of
> > +refs. An example:
> > ++
> > +--------------------------------------------------------------------------------
> > +[gitweb]
> > + extrabranchrefs = sandbox wip other
> > +--------------------------------------------------------------------------------
>
> O.K.
>
> > ++
> > +The gitweb.extrabranchrefs is actually a multi-valued configuration
> > +variable, so following example is also correct and the result is the
> > +same as of the snippet above:
> > ++
> > +--------------------------------------------------------------------------------
> > +[gitweb]
> > + extrabranchrefs = sandbox
> > + extrabranchrefs = wip other
> > +--------------------------------------------------------------------------------
>
> I think this part should be better left for a separate patch. There is
> important difference between single-valued and multi-valued configuration
> variable: with single-valued later occurrences override earlier ones,
> which includes settings in more specific config file (e.g. per-repository)
> overriding setting in more general one (e.g. per-user or system-wide).
>
> With multi-valued we won't be able to override earlier / more generic
> settings... well, unless we add support for no-value, or empty-value
> as clearer, i.e.
>
> [gitweb]
> extrabranchrefs = sandbox
> extrabranchrefs
> # or extrabranchrefs =
> extrabranchrefs = wip other
>
> resulting in ('wip', 'other').
That point in this example is a bit moot IMO - if you don't want sandbox
ref to appear in list of branches view then just delete the offending
line.
I also made a small experiment. In per-instance config I have
$feature{'extra-branch-refs'}{'default'} = ['wip'];
$feature{'extra-branch-refs'}{'override'} = 1;
In per-repository config I have:
[gitweb]
extrabranchrefs = sandbox
extrabranchrefs = other
List of branches view shows only branches from sandbox and other. So
clearly per-repository config overrides per-instance config.
>
> > ++
> > +It is an error to specify a ref that does not pass "git check-ref-format"
> > +scrutiny. Duplicated values are filtered.
> > +
>
> Hmmm... 'snapshot' feature ignores invalid values, but in this case
> formerly valid compression schemes might get invalid via tightening
> %known_snapshot_formats, and we don't want existing config getting
> suddenly invalid.
>
So, should I just ignore the invalid refs or treat them as errors?
> [cut]
>
> Nice!
>
--
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-05 10:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-04 13:42 [PATCH 0/5] Show extra branch refs in gitweb v6 Krzesimir Nowak
2013-12-04 13:42 ` [PATCH 1/5] gitweb: Add a comment explaining the meaning of $/ Krzesimir Nowak
2013-12-04 15:11 ` Jakub Narębski
2013-12-04 15:46 ` Krzesimir Nowak
2013-12-04 16:19 ` Martin Langhoff
2013-12-04 20:28 ` Junio C Hamano
2013-12-05 9:16 ` Krzesimir Nowak
2013-12-04 17:34 ` Jakub Narębski
2013-12-04 17:37 ` Jakub Narębski
2013-12-04 13:43 ` [PATCH 2/5] gitweb: Move check-ref-format code into separate function Krzesimir Nowak
2013-12-04 15:56 ` Jakub Narębski
2013-12-05 9:19 ` Krzesimir Nowak
2013-12-04 20:31 ` Junio C Hamano
2013-12-05 9:18 ` Krzesimir Nowak
2013-12-04 13:43 ` [PATCH 3/5] gitweb: Return plain booleans in validation methods Krzesimir Nowak
2013-12-04 16:07 ` Jakub Narębski
2013-12-04 18:11 ` Junio C Hamano
2013-12-05 9:23 ` Krzesimir Nowak
2013-12-05 18:16 ` Junio C Hamano
2013-12-05 19:11 ` Jakub Narębski
2013-12-05 20:01 ` Junio C Hamano
2013-12-04 13:43 ` [PATCH 4/5] gitweb: Add a feature for adding more branch refs Krzesimir Nowak
2013-12-04 18:06 ` Jakub Narębski
2013-12-05 10:00 ` Krzesimir Nowak [this message]
2013-12-05 11:40 ` Jakub Narębski
2013-12-10 16:04 ` Krzesimir Nowak
2013-12-10 18:54 ` Junio C Hamano
2013-12-10 19:06 ` Jakub Narębski
2013-12-10 19:44 ` Junio C Hamano
2013-12-04 13:43 ` [PATCH 5/5] gitweb: Denote non-heads, non-remotes branches Krzesimir Nowak
2013-12-04 18:54 ` Jakub Narębski
2013-12-04 20:37 ` [PATCH 0/5] Show extra branch refs in gitweb v6 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=1386237635.2186.22.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.