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

Re: [PATCH] gitweb: fixes to gitweb feature check code

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 3, 2008, 01:21 UTC
Message-ID
<200812030221.31180.jnareb@gmail.com>
In-Reply-To
<7v4p1mp7hx.fsf@gitster.siamese.dyndns.org>
Dnia wtorek 2. grudnia 2008 22:55, Junio C Hamano napisał:
Show 24 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > What I like about having all this, i.e. fix, futureproof and style
> > correction in one single patch is the fact that fix doesn't introduce
> > strange looking (gitweb_check_feature('bool_feat'))[0]... well, except
> > encapsulated in a subroutine.
> >
> > From all possible splits of this feature into series of up to three
> > patches I think I like the one with pure subroutine rename from *check*
> > to *get* least...
> 
> Well, I have to say that you have a strange taste, sense of priorities,
> and perhaps aversion to logical progression.  Let's explain one more
> time.
> 
> The case we had at hand was that a callee has a less-than-ideal calling
> convention that has caused a few bugs by callers because they did not
> understand the calling convention.  You can argue it is not entirely
> caller's fault that they failed to follow the calling convention, but the
> fact remains that there are bugs taken as a whole.
> 
> First we fix the callers, because existing bugs get highest priority.
> This is a pure bugfix patch that could even go to maintenance "bugfix
> only" branch.
I agree here.
Show 5 quoted lines
> Then we fix the calling convention because we all know that the calling
> convention was less-than-ideal.  A large part of the reason the calling
> convention was confusing was because the wording "check" implied it was a
> boolean function.  Logically, s/check/get/ would be a major part of fixing
> that.
And here I slightly disagree. The lone change s/check/get/ doesn't
actually do anything. Splitting wrongly named 'check' into checking
if feature is enabled and actual getting config does. And it is IMVHO
quote obvious which calls are to be to new semantic of 'check':
  my ($var) = gitweb_check_feature('feature');
and
  (gitweb_check_feature('feature'))[0]
and which are to be renamed to 'get':
  my ($a, $b) = gitweb_check_feature('feature');
and
  my @a  = gitweb_check_feature('feature');

Perhaps it is more clear from the point of view of reviewing individual pieces...

-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Giuseppe Bilotta
Message 19 of 26 in “[PATCHv2 0/2] fixes to gitweb feature check code”
  1. Giuseppe BilottaNov 28, 2008
  2. 1/2 gitweb: fixes to gitweb feature check codeGiuseppe Bilotta, Nov 28, 2008
  3. 2/2 gitweb: clean up git_check_feature() callsGiuseppe Bilotta, Nov 28, 2008
  4. 2/2 gitweb: clean up gitweb_check_feature() callsGiuseppe Bilotta, Nov 29, 2008
  5. Jakub NarebskiNov 29, 2008
  6. 2/2 gitweb: clean up gitweb_check_feature() callsGiuseppe Bilotta, Nov 29, 2008
  7. Junio C HamanoNov 29, 2008
  8. Junio C HamanoNov 29, 2008
  9. 2/3 gitweb: rename gitweb_check_feature to gitweb_get_featureJunio C Hamano, Nov 29, 2008
  10. 3/3 gitweb: make gitweb_check_feature a boolean wrapperJunio C Hamano, Nov 29, 2008
  11. Giuseppe BilottaNov 29, 2008
  12. Junio C HamanoNov 30, 2008
  13. Giuseppe BilottaNov 30, 2008
  14. gitweb: fixes to gitweb feature check codeGiuseppe Bilotta, Nov 30, 2008
  15. Jakub NarebskiDec 2, 2008
  16. [PATCHv3bis] gitweb: fixes to gitweb feature check codeGiuseppe Bilotta, Dec 2, 2008
  17. Junio C HamanoDec 3, 2008
  18. Junio C HamanoDec 2, 2008
  19. Jakub NarebskiDec 3, 2008
  20. Giuseppe BilottaNov 29, 2008
  21. Junio C HamanoNov 29, 2008
  22. Jakub NarebskiNov 29, 2008
  23. Jakub NarebskiNov 29, 2008
  24. Jakub NarebskiNov 30, 2008
  25. Jakub NarebskiNov 29, 2008
  26. Giuseppe BilottaNov 29, 2008

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.