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: Dan Libby <hidden>
Date: 2016-06-15 22:43:36

Possibly related (same subject, not in this thread)

Hi Matthias,

So the svnimport (with your patch) chugged along for quite a while, but now 
I've run into a new (related?) problem.  Here's the output:

--
Merge parent branch: 57b2ce794c20e71efa9c7bd0cc71df72e01f5d39
Commit ID 37f501fd2fd0d309b4d3fdce77bac13c84646423
Writing to refs/heads/Verny
DONE: 2385 Verny 37f501fd2fd0d309b4d3fdce77bac13c84646423
Switching from 37f501fd2fd0d309b4d3fdce77bac13c84646423 to 
0e1b0bb88f077b66c6cf537899ab6c0a69d5ec30 (/Cristian new code)
we do not like 'Cristian new code' as a tag name.
Cannot create tag Cristian new code: Bad file descriptor
--

This is a fatal error that stops the import.

regards,

On Tuesday 18 September 2007 03:29, Matthias Urlichs wrote:
quoted hunk ↗ jump to hunk
Some people seem to create SVN branch names with spaces
or other shell metacharacters.

Signed-Off-By: Matthias Urlichs <redacted>
---

Junio C Hamano:
quoted
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";
-- 
Dan Libby

Open Source Consulting
San Jose, Costa Rica
http://osc.co.cr
phone: 011 506 223 7382
Fax: 011 506 223 7359
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help