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

Re: [PATCH] Read cvsimport options from repo-config

From
EWEric Wong <normalperson@yhbt.net>
Date
Feb 11, 2007, 05:13 UTC
Message-ID
<20070211051353.GA9481@localdomain>
In-Reply-To
<7vireflxna.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 11 quoted lines
> 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
Previous: James Bowes
Message 4 of 4 in “Read cvsimport options from repo-config”
  1. Read cvsimport options from repo-configJames Bowes, Feb 6, 2007
  2. Junio C HamanoFeb 6, 2007
  3. James BowesFeb 7, 2007
  4. Eric WongFeb 11, 2007

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.