git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <junkio@cox.net>
Cc: James Bowes <jbowes@dangerouslyinc.com>, git@vger.kernel.org
Subject: Re: [PATCH] Read cvsimport options from repo-config
Date: Sat, 10 Feb 2007 21:13:53 -0800	[thread overview]
Message-ID: <20070211051353.GA9481@localdomain> (raw)
In-Reply-To: <7vireflxna.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> I find what your patch does quite sensible, although the
> split(/ *(?!:)/) magic might be a bit hard to read for the
> uninitiated.
> 
> > +		my $arg = 'git-repo-config';
> > +		$arg .= ' --bool' if ($o !~ /:$/);
> > +
> > +        chomp(my $tmp = `$arg --get cvsimport.$key`);
> > +		if ($tmp && !($arg =~ / --bool / && $tmp eq 'false')) {
> 
> Can this =~ / --bool / ever match (note the SP after 'l')?

Heh, the same bug has been in git-svn for ages, too.

>From 0bece11c0019a7d2a2dcb71c42536ee45f523c47 Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Sat, 10 Feb 2007 21:07:12 -0800
Subject: [PATCH] git-svn: correctly handle boolean options via git-config

We don't append a space after '--bool', so we can't expect
a regular expression to match the space.

Semi-noticed by Junio C Hamano :)

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 8ebaae9..d792a62 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1610,7 +1610,7 @@ sub read_repo_config {
 			@$v = @tmp if @tmp;
 		} else {
 			chomp(my $tmp = `$arg --get svn.$key`);
-			if ($tmp && !($arg =~ / --bool / && $tmp eq 'false')) {
+			if ($tmp && !($arg =~ / --bool/ && $tmp eq 'false')) {
 				$$v = $tmp;
 			}
 		}
-- 
Eric Wong

      parent reply	other threads:[~2007-02-11  5:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-06  1:22 [PATCH] Read cvsimport options from repo-config James Bowes
2007-02-06  4:26 ` Junio C Hamano
2007-02-07 22:57   ` James Bowes
2007-02-11  5:13   ` Eric Wong [this message]

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=20070211051353.GA9481@localdomain \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=jbowes@dangerouslyinc.com \
    --cc=junkio@cox.net \
    /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;
as well as URLs for NNTP newsgroup(s).