From: Jakub Narebski Date: Sat, 29 Nov 2008 10:48:13 GMT Subject: Re: [PATCHv2 0/2] fixes to gitweb feature check code Message-ID: <200811291148.15182.jnareb@gmail.com> In-Reply-To: <1227904793-1821-1-git-send-email-giuseppe.bilotta@gmail.com> Dnia piątek 28. listopada 2008 21:39, Giuseppe Bilotta napisał: > This is v2 of the gitweb feature check fix patch, which has now been > split into into a code patch and cleanup patch. > > The first patch introduces git_get_feature() to clearly distinguish the > feature retrieval from the boolean feature check (which is kept at > git_check_feature()). The new function is used where appropriate. > > The second patch cleans up use of git_check_feature(): since the > function now returns a boolean instead of an array, the often-used > construct > my ($somevar) = git_check_feature('somefeat'); > although still valid, becomes a rather clumsy stylistic choice, as it > introduces an unnecessary ambiguity. Make it clear that we're now > dealing with scalars by using scalar assignment. It is gitweb_get_feature() (for retrieval) and gitweb_check_feature() (for checking), not git_get_feature() and git_check_feature(). I really like this series; making coding easier by removing need to use special construct, and making it easier to avoid mistakes is always a good thing. > Giuseppe Bilotta (2): > gitweb: fixes to gitweb feature check code > gitweb: clean up git_check_feature() calls > > gitweb/gitweb.perl | 52 +++++++++++++++++++++++++++++++++++----------------- > 1 files changed, 35 insertions(+), 17 deletions(-) I also like the split, as it separates improvement (much easier to use and less error prone gitweb_check_feature()) from style cleanup. -- Jakub Narebski Poland