Git development
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Matt Kraai <kraai@ftbfs.org>
Cc: demerphq <demerphq@gmail.com>, Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] gitweb: merge boolean feature subroutines
Date: Sun, 04 Jan 2009 14:07:53 -0800 (PST)	[thread overview]
Message-ID: <m37i5abu8a.fsf@localhost.localdomain> (raw)
In-Reply-To: <20090104155858.GC4205@ftbfs.org>

Matt Kraai <kraai@ftbfs.org> writes:

> I agree that what you suggest is better than the alternatives you
> present.  Unfortunately, none of them match the current behavior.
> Here's the current code:
> 
> 	if ($val eq 'true') {
> 		return 1;
> 	} elsif ($val eq 'false') {
> 		return 0;
> 	}
> 
> 	return $_[0];
> 
> Is there a way to use the form you suggest while falling back to the
> default if $val isn't set to 'true' or 'false'?

IIRC the return value is actually threestate: 1 for true, 0 for false,
and undef for non-bool config value.

BTW. git_get_project_config currently emulates old one git-config call
per configuration variable, with git-config normalizing boolean values
(returning 'true' or 'false'). But it could return Perl truish or Perl
falsish instead, as we now use "git config -l -z" + caching config
variables, and it is Perl that does normalization of boolean values.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2009-01-04 22:09 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
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 [this message]
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=m37i5abu8a.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=demerphq@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kraai@ftbfs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox