git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/5] gitweb: Add a feature for adding more branch refs

From
Jakub Narębski <jnareb@gmail.com>
Date
Dec 5, 2013, 11:40 UTC
Message-ID
<CANQwDwdfbAyJyCWwEXBDp5BGz1JvVj_eUn5NOCWEthUtKfF5Lg@mail.gmail.com>
In-Reply-To
<1386237635.2186.22.camel@localhost.localdomain>
On Thu, Dec 5, 2013 at 11:00 AM, Krzesimir Nowak <krzesimir@endocode.com> wrote:
> 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:
Show 27 quoted lines
>>> +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').

What I didn't notice is that gitweb already supports and *uses* multi-value configuration variables: gitweb.url and gitweb.ctag (note: the feature is called 'ctags' and is not overridable), though not for %feature-s.

So the point is moot, sorry for distraction.
BTW. there is config_to_multi() subroutine that you can use.
> 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 was thinking about more complicated situation: if you have gitweb configured in "scan for repositories" mode (like mod_homedir), then repository owner may change gitweb configuration for own repository via repo config file. But gitweb reads also web server user config file and system wide git config file (/etc/gitconfig). If gitweb.extraBranchRefs is set in one of those files, repo owner cannot override, but only add to it.

But I think this is worrying about nothing. I'm sorry for distraction.
Show 11 quoted lines
> 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.

That's why is called 'override'... but it is not what I was worrying about, see above.

-- 
Jakub Narebski
Previous: Krzesimir NowakNext: Krzesimir Nowak
Message 25 of 32 in “Show extra branch refs in gitweb v6”
  1. 0/5 Show extra branch refs in gitweb v6Krzesimir Nowak, Dec 4, 2013
  2. 1/5 gitweb: Add a comment explaining the meaning of $/Krzesimir Nowak, Dec 4, 2013
  3. Jakub NarębskiDec 4, 2013
  4. Krzesimir NowakDec 4, 2013
  5. Martin LanghoffDec 4, 2013
  6. Junio C HamanoDec 4, 2013
  7. Krzesimir NowakDec 5, 2013
  8. Jakub NarębskiDec 4, 2013
  9. Jakub NarębskiDec 4, 2013
  10. 2/5 gitweb: Move check-ref-format code into separate functionKrzesimir Nowak, Dec 4, 2013
  11. Jakub NarębskiDec 4, 2013
  12. Krzesimir NowakDec 5, 2013
  13. Junio C HamanoDec 4, 2013
  14. Krzesimir NowakDec 5, 2013
  15. 3/5 gitweb: Return plain booleans in validation methodsKrzesimir Nowak, Dec 4, 2013
  16. Jakub NarębskiDec 4, 2013
  17. Junio C HamanoDec 4, 2013
  18. Krzesimir NowakDec 5, 2013
  19. Junio C HamanoDec 5, 2013
  20. Jakub NarębskiDec 5, 2013
  21. Junio C HamanoDec 5, 2013
  22. 4/5 gitweb: Add a feature for adding more branch refsKrzesimir Nowak, Dec 4, 2013
  23. Jakub NarębskiDec 4, 2013
  24. Krzesimir NowakDec 5, 2013
  25. Jakub NarębskiDec 5, 2013
  26. Krzesimir NowakDec 10, 2013
  27. Junio C HamanoDec 10, 2013
  28. Jakub NarębskiDec 10, 2013
  29. Junio C HamanoDec 10, 2013
  30. 5/5 gitweb: Denote non-heads, non-remotes branchesKrzesimir Nowak, Dec 4, 2013
  31. Jakub NarębskiDec 4, 2013
  32. Junio C HamanoDec 4, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.