Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

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

From: Eric Wong <hidden>
Date: 2016-06-15 22:42:53
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] wrote:
I find what your patch does quite sensible, although the
split(/ *(?!:)/) magic might be a bit hard to read for the
uninitiated.
quoted
+		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 <redacted>
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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help