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

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

From
Matthias Urlichs <smurf@smurf.noris.de>
Date
Sep 18, 2007, 09:29 UTC
Message-ID
<20070918092909.GU31176@kiste.smurf.noris.de>
In-Reply-To
<7vlkb4wdzq.fsf@gitster.siamese.dyndns.org>

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

Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
---
Junio C Hamano:
Show 7 quoted lines
> > -		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
Previous: Junio C HamanoNext: Dan Libby
Message 3 of 9 in “git-svnimport: Use separate arguments in the pipe for git-rev-parse”
  1. git-svnimport: Use separate arguments in the pipe for git-rev-parseMatthias Urlichs, Sep 18, 2007
  2. Junio C HamanoSep 18, 2007
  3. Matthias UrlichsSep 18, 2007
  4. Dan LibbySep 20, 2007
  5. Matthias UrlichsSep 21, 2007
  6. Junio C HamanoSep 21, 2007
  7. Matthias UrlichsSep 21, 2007
  8. Dan LibbySep 21, 2007
  9. Dan LibbySep 20, 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.