From: Matt Kraai <kraai@ftbfs.org>
To: demerphq <demerphq@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: merge boolean feature subroutines
Date: Sat, 3 Jan 2009 08:40:24 -0800 [thread overview]
Message-ID: <20090103164024.GA4205@ftbfs.org> (raw)
In-Reply-To: <9b18b3110901030818i242d81ccl20ef3f264ec64cad@mail.gmail.com>
On Sat, Jan 03, 2009 at 05:18:44PM +0100, demerphq wrote:
> 2009/1/3 Matt Kraai <kraai@ftbfs.org>:
> [...]
> > -sub feature_blame {
> > - my ($val) = git_get_project_config('blame', '--bool');
> > +sub feature_bool {
> > + my $key = shift;
> > + my ($val) = git_get_project_config($key, '--bool');
> >
> > if ($val eq 'true') {
> > return 1;
>
> Maybe that should be:
>
> return ($val eq 'true');
>
> as It is not a good idea to use 0 as a replacement for perls false, as
> the two have different behaviour.
>
> $perl -wle'my $val=shift; my $x=$val eq "true"; print "<$_>" for $x, 0+$x' false
> <>
> <0>
I don't think Perl has *a* false value, but rather has multiple values
that are treated as false, such as undef, zero, and the empty string.
Personally, I find 0 clearer than the empty string, but that's
probably just my C bias sneaking in.
All of the boolean feature values use 0 or 1, so if this should be
changed, I think it should probably be done as a separate patch.
--
Matt http://ftbfs.org/
next prev parent reply other threads:[~2009-01-03 16:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-03 15:31 [PATCH] gitweb: merge boolean feature subroutines Matt Kraai
2009-01-03 15:31 ` [PATCH] gitweb: pass the key to the " Matt Kraai
2009-01-03 16:18 ` [PATCH] gitweb: merge boolean " demerphq
2009-01-03 16:40 ` Matt Kraai [this message]
2009-01-03 16:51 ` demerphq
2009-01-03 17:13 ` Matt Kraai
2009-01-03 17:41 ` demerphq
2009-01-04 5:30 ` Junio C Hamano
2009-01-04 11:41 ` demerphq
2009-01-04 15:58 ` Matt Kraai
2009-01-04 22:07 ` Jakub Narebski
2009-01-04 21:25 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090103164024.GA4205@ftbfs.org \
--to=kraai@ftbfs.org \
--cc=demerphq@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.