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

Re: [RFC/PATCH] gitweb: link to toggle 'no merges' option

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 17, 2009, 21:14 UTC
Message-ID
<200912172214.27001.jnareb@gmail.com>
In-Reply-To
<cb7bb73a0912171241j56ecd2f1y3dc66cf3b86bd784@mail.gmail.com>
Giuseppe Bilotta wrote:
> 2009/12/17 Jakub Narebski <jnareb@gmail.com>:
>> On Thu, 17 Dec 2009 10:05 +0100, Giuseppe Bilotta wrote:
[...]
Show 15 quoted lines
>>> +     my $can_have_merges = grep(/^$action$/, @{$allowed_options{'--no-merges'}});
>>> +     my $has_merges = !grep(/^--no-merges$/, @extra_options);
>>> +
>>
>> Wouldn't it be better to use straight
>>
>>  +      my $no_merges = grep(/^--no-merges$/, @extra_options);
>>
>> Because $has_merges is true also for example for 'tree' view... which
>> absolutely doesn't make any sense whatsoever.
> 
> The reason why I have two vars is that one checks if we care about the
> option, and the other is to see if it's enabled or not. We don't want
> the 'show merges' toggle to appear in view which don't handle the
> --no-merge option.
Perhaps I didn't made myself clear.

What I wanted to ask is to switch $has_merges to $no_merges, not to remove $can_have_merges. Its a question of semantics of $has_merges, which do not mean that action has (handles) merges.

This is of course the question of style, but I think this would make code more maintainable.

Of course if you go %extra_options hash route this issue wouldn't matter.
-- 
Jakub Narebski
Poland
Previous: Giuseppe Bilotta
Message 5 of 5 in “gitweb: link to toggle 'no merges' option”
  1. gitweb: link to toggle 'no merges' optionGiuseppe Bilotta, Dec 17, 2009
  2. Etienne Vallette d'OsiaDec 17, 2009
  3. Jakub NarebskiDec 17, 2009
  4. Giuseppe BilottaDec 17, 2009
  5. Jakub NarebskiDec 17, 2009

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.