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

Re: [PATCH v2] gitweb: Add an option for adding more branch refs

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Nov 27, 2013, 20:34 UTC
Message-ID
<CAPig+cT=P3ZC9j-WwQjr7gu6RrNgLrXsPkiVmdy5OGYfu8mPqA@mail.gmail.com>
In-Reply-To
<1385566221-7977-1-git-send-email-krzesimir@endocode.com>

On Wed, Nov 27, 2013 at 10:30 AM, Krzesimir Nowak <krzesimir@endocode.com> wrote:

Show 21 quoted lines
> Overriding an @additional_branch_refs configuration variable with
> value ('wip') will make gitweb to show branches that appear in
> refs/heads and refs/wip (refs/heads is hardcoded). Might be useful for
> gerrit setups where user branches are not stored under refs/heads/.
>
> Signed-off-by: Krzesimir Nowak <krzesimir@endocode.com>
> ---
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 68c77f6..499281b 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 in @additional_branch_refs') unless (validate_ref($ref));

Mentioning $ref in the error message would help the user resolve the problem more quickly.

> +               die_error(500, '"heads" specified in @additional_branch_refs') if ($ref eq 'heads');
Rephrasing this as
    "heads" disallowed in @additional_branch_refs

would better explain the problem to a user who has only made a cursory read of the documentation.

Show 9 quoted lines
> +               die_error(500, "Ref '$ref' repeated in \@additional_branch_refs") if (exists $unique_branch_refs{$ref});
> +               $unique_branch_refs{$ref} = 1;
> +       }
> +       %unique_branch_refs = undef;
> +}
> +
>  our ($GITWEB_CONFIG, $GITWEB_CONFIG_SYSTEM, $GITWEB_CONFIG_COMMON);
>  sub evaluate_gitweb_config {
>         our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
Previous: Krzesimir NowakNext: Eric Sunshine
Message 2 of 5 in “gitweb: Add an option for adding more branch refs”
  1. gitweb: Add an option for adding more branch refsKrzesimir Nowak, Nov 27, 2013
  2. Eric SunshineNov 27, 2013
  3. Eric SunshineNov 27, 2013
  4. Junio C HamanoNov 27, 2013
  5. Krzesimir NowakNov 28, 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.