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

Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse

From: Matthias Urlichs <hidden>
Date: 2016-06-15 22:43:35
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Some people seem to create SVN branch names with spaces
or other shell metacharacters.

Signed-Off-By: Matthias Urlichs <redacted>
---
Junio C Hamano:
quoted
-		open(H,"git-rev-parse --verify $parent |");
+		open(H,'-|',"git-rev-parse","--verify",$parent);
I seem to be missing the context, but please describe what
problem this fixes in the commit log message.  I guess some
people use shell metacharacters and/or SP in their branch names
and this is about that problem?
Exactly. Sorry; it seems that the original question hasn't been posted
to the mailing list.
diff --git a/git-svnimport.perl b/git-svnimport.perl
index d3ad5b9..aa5b3b2 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -633,7 +633,7 @@ sub commit {
 
 	my $rev;
 	if($revision > $opt_s and defined $parent) {
-		open(H,"git-rev-parse --verify $parent |");
+		open(H,'-|',"git-rev-parse","--verify",$parent);
 		$rev = <H>;
 		close(H) or do {
 			print STDERR "$revision: cannot find commit '$parent'!\n";


-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
BOFH excuse #11:

magnetic interference from money/credit cards
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help