{"thread":{"id":"9911","subject":"[PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","startedAt":"2007-09-18T07:47:53Z","lastAt":"2007-09-21T20:21:56Z","messageCount":9,"participants":["Matthias Urlichs","Junio C Hamano","Dan Libby"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"53413","messageId":"20070918074753.GQ31176@kiste.smurf.noris.de","threadId":"9911","inReplyTo":"200709171333.48331.danda@osc.co.cr","subject":"[PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2007-09-18T07:47:53Z","receivedAt":"2007-09-18T07:47:53Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"\nSigned-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n---\nPlease tell me whether that works for you.\n\nSomebody else, preferably its author, can fix git-svn. ;-)\n\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex d3ad5b9..aa5b3b2 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -633,7 +633,7 @@ sub commit {\n \n \tmy $rev;\n \tif($revision > $opt_s and defined $parent) {\n-\t\topen(H,\"git-rev-parse --verify $parent |\");\n+\t\topen(H,'-|',\"git-rev-parse\",\"--verify\",$parent);\n \t\t$rev = <H>;\n \t\tclose(H) or do {\n \t\t\tprint STDERR \"$revision: cannot find commit '$parent'!\\n\";\n-- \n1.5.2.5\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\n\"Could a being create the fifty billion galaxies, each with two hundred\n billion stars, then rejoice in the smell of burning goat flesh?\"\n                         [Ron Patterson]\n"},{"id":"53416","messageId":"7vlkb4wdzq.fsf@gitster.siamese.dyndns.org","threadId":"9911","inReplyTo":"20070918074753.GQ31176@kiste.smurf.noris.de","subject":"Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-18T08:54:01Z","receivedAt":"2007-09-18T08:54:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthias Urlichs <smurf@smurf.noris.de> writes:\n\n> Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n> ---\n> Please tell me whether that works for you.\n>\n> Somebody else, preferably its author, can fix git-svn. ;-)\n> \n> diff --git a/git-svnimport.perl b/git-svnimport.perl\n> index d3ad5b9..aa5b3b2 100755\n> --- a/git-svnimport.perl\n> +++ b/git-svnimport.perl\n> @@ -633,7 +633,7 @@ sub commit {\n>  \n>  \tmy $rev;\n>  \tif($revision > $opt_s and defined $parent) {\n> -\t\topen(H,\"git-rev-parse --verify $parent |\");\n> +\t\topen(H,'-|',\"git-rev-parse\",\"--verify\",$parent);\n>  \t\t$rev = <H>;\n>  \t\tclose(H) or do {\n>  \t\t\tprint STDERR \"$revision: cannot find commit '$parent'!\\n\";\n\nI seem to be missing the context, but please describe what\nproblem this fixes in the commit log message.  I guess some\npeople use shell metacharacters and/or SP in their branch names\nand this is about that problem?\n"},{"id":"53433","messageId":"20070918092909.GU31176@kiste.smurf.noris.de","threadId":"9911","inReplyTo":"7vlkb4wdzq.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2007-09-18T09:29:09Z","receivedAt":"2007-09-18T09:29:09Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Some people seem to create SVN branch names with spaces\nor other shell metacharacters.\n\nSigned-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n---\nJunio C Hamano:\n> > -\t\topen(H,\"git-rev-parse --verify $parent |\");\n> > +\t\topen(H,'-|',\"git-rev-parse\",\"--verify\",$parent);\n> \n> I seem to be missing the context, but please describe what\n> problem this fixes in the commit log message.  I guess some\n> people use shell metacharacters and/or SP in their branch names\n> and this is about that problem?\n\nExactly. Sorry; it seems that the original question hasn't been posted\nto the mailing list.\n\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex d3ad5b9..aa5b3b2 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -633,7 +633,7 @@ sub commit {\n \n \tmy $rev;\n \tif($revision > $opt_s and defined $parent) {\n-\t\topen(H,\"git-rev-parse --verify $parent |\");\n+\t\topen(H,'-|',\"git-rev-parse\",\"--verify\",$parent);\n \t\t$rev = <H>;\n \t\tclose(H) or do {\n \t\t\tprint STDERR \"$revision: cannot find commit '$parent'!\\n\";\n\n\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nBOFH excuse #11:\n\nmagnetic interference from money/credit cards\n"},{"id":"53671","messageId":"200709201307.01922.danda@osc.co.cr","threadId":"9911","inReplyTo":"20070918074753.GQ31176@kiste.smurf.noris.de","subject":"Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Dan Libby","fromEmail":"danda@osc.co.cr","sentAt":"2007-09-20T19:07:01Z","receivedAt":"2007-09-20T19:07:01Z","isPatch":true,"sender":{"key":"danda@osc.co.cr","avatar":null},"body":"Hi, it worked for the small test case.  I am trying it on the large repo now, \nand will let you know how it turns out.  thanks!\n\nOn Tuesday 18 September 2007 01:47, Matthias Urlichs wrote:\n> Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n> ---\n> Please tell me whether that works for you.\n>\n> Somebody else, preferably its author, can fix git-svn. ;-)\n>\n> diff --git a/git-svnimport.perl b/git-svnimport.perl\n> index d3ad5b9..aa5b3b2 100755\n> --- a/git-svnimport.perl\n> +++ b/git-svnimport.perl\n> @@ -633,7 +633,7 @@ sub commit {\n>\n>  \tmy $rev;\n>  \tif($revision > $opt_s and defined $parent) {\n> -\t\topen(H,\"git-rev-parse --verify $parent |\");\n> +\t\topen(H,'-|',\"git-rev-parse\",\"--verify\",$parent);\n>  \t\t$rev = <H>;\n>  \t\tclose(H) or do {\n>  \t\t\tprint STDERR \"$revision: cannot find commit '$parent'!\\n\";\n> --\n> 1.5.2.5\n\n-- \nDan Libby\n\nOpen Source Consulting\nSan Jose, Costa Rica\nhttp://osc.co.cr\nphone: 011 506 223 7382\nFax: 011 506 223 7359\n"},{"id":"53672","messageId":"200709201340.17023.danda@osc.co.cr","threadId":"9911","inReplyTo":"20070918092909.GU31176@kiste.smurf.noris.de","subject":"Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Dan Libby","fromEmail":"danda@osc.co.cr","sentAt":"2007-09-20T19:40:16Z","receivedAt":"2007-09-20T19:40:16Z","isPatch":true,"sender":{"key":"danda@osc.co.cr","avatar":null},"body":"Hi Matthias,\n\nSo the svnimport (with your patch) chugged along for quite a while, but now \nI've run into a new (related?) problem.  Here's the output:\n\n--\nMerge parent branch: 57b2ce794c20e71efa9c7bd0cc71df72e01f5d39\nCommit ID 37f501fd2fd0d309b4d3fdce77bac13c84646423\nWriting to refs/heads/Verny\nDONE: 2385 Verny 37f501fd2fd0d309b4d3fdce77bac13c84646423\nSwitching from 37f501fd2fd0d309b4d3fdce77bac13c84646423 to \n0e1b0bb88f077b66c6cf537899ab6c0a69d5ec30 (/Cristian new code)\nwe do not like 'Cristian new code' as a tag name.\nCannot create tag Cristian new code: Bad file descriptor\n--\n\nThis is a fatal error that stops the import.\n\nregards,\n\nOn Tuesday 18 September 2007 03:29, Matthias Urlichs wrote:\n> Some people seem to create SVN branch names with spaces\n> or other shell metacharacters.\n>\n> Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n> ---\n>\n> Junio C Hamano:\n> > > -\t\topen(H,\"git-rev-parse --verify $parent |\");\n> > > +\t\topen(H,'-|',\"git-rev-parse\",\"--verify\",$parent);\n> >\n> > I seem to be missing the context, but please describe what\n> > problem this fixes in the commit log message.  I guess some\n> > people use shell metacharacters and/or SP in their branch names\n> > and this is about that problem?\n>\n> Exactly. Sorry; it seems that the original question hasn't been posted\n> to the mailing list.\n>\n> diff --git a/git-svnimport.perl b/git-svnimport.perl\n> index d3ad5b9..aa5b3b2 100755\n> --- a/git-svnimport.perl\n> +++ b/git-svnimport.perl\n> @@ -633,7 +633,7 @@ sub commit {\n>\n>  \tmy $rev;\n>  \tif($revision > $opt_s and defined $parent) {\n> -\t\topen(H,\"git-rev-parse --verify $parent |\");\n> +\t\topen(H,'-|',\"git-rev-parse\",\"--verify\",$parent);\n>  \t\t$rev = <H>;\n>  \t\tclose(H) or do {\n>  \t\t\tprint STDERR \"$revision: cannot find commit '$parent'!\\n\";\n\n-- \nDan Libby\n\nOpen Source Consulting\nSan Jose, Costa Rica\nhttp://osc.co.cr\nphone: 011 506 223 7382\nFax: 011 506 223 7359\n"},{"id":"53696","messageId":"20070921061122.GI11204@kiste.smurf.noris.de","threadId":"9911","inReplyTo":"200709201340.17023.danda@osc.co.cr","subject":"Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2007-09-21T06:11:22Z","receivedAt":"2007-09-21T06:11:22Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nDan Libby:\n> we do not like 'Cristian new code' as a tag name.\n\nDuh? That's a perfectly valid tag name.\nI have no idea why git croaked on this one.\n\nPlease run \n\n    strace -f -s300 -eexecve git-svnimport ... 2>&1 | \\\n\t\tgrep check-ref-format | grep -v ENOENT\n\nand mail me the output, replacing the \"...\" with your normal arguments\nof course.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nTaken as a whole, the universe is absurd.\n\t\t\t\t\t-- Walter Savage Landor\n"},{"id":"53699","messageId":"7vabrgjyg3.fsf@gitster.siamese.dyndns.org","threadId":"9911","inReplyTo":"20070921061122.GI11204@kiste.smurf.noris.de","subject":"Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-09-21T06:59:40Z","receivedAt":"2007-09-21T06:59:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthias Urlichs <smurf@smurf.noris.de> writes:\n\n>> we do not like 'Cristian new code' as a tag name.\n>\n> Duh? That's a perfectly valid tag name.\n\nIs it?\n\n$ man git-check-ref-format\n"},{"id":"53709","messageId":"20070921102420.GJ11204@kiste.smurf.noris.de","threadId":"9911","inReplyTo":"7vabrgjyg3.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2007-09-21T10:24:20Z","receivedAt":"2007-09-21T10:24:20Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nJunio C Hamano:\n> Matthias Urlichs <smurf@smurf.noris.de> writes:\n> \n> >> we do not like 'Cristian new code' as a tag name.\n> >\n> > Duh? That's a perfectly valid tag name.\n> \n> Is it?\n> \n> $ man git-check-ref-format\n\nBah, stupid me. You're right, obviously.\n\nI'll replace them with underscores. :-/\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nMurphy's Law:\nIf anything can go wrong, it will.\n"},{"id":"53744","messageId":"200709211421.56587.danda@osc.co.cr","threadId":"9911","inReplyTo":"20070921102420.GJ11204@kiste.smurf.noris.de","subject":"Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse","fromName":"Dan Libby","fromEmail":"danda@osc.co.cr","sentAt":"2007-09-21T20:21:56Z","receivedAt":"2007-09-21T20:21:56Z","isPatch":true,"sender":{"key":"danda@osc.co.cr","avatar":null},"body":"Hi,\n\nI saw this, so I haven't run the strace command you mentioned.  No need now, \nright?\n\nI'm no expert on these things, but I'd think that it should be replacing (or \nescaping) any characters (not just spaces) that are not allowed by \ngit-check-ref-format.\n\nFor us, replacing any such characters with _ should work fine.\n\nregards,\n\nOn Friday 21 September 2007 04:24, Matthias Urlichs wrote:\n> Hi,\n>\n> Junio C Hamano:\n> > Matthias Urlichs <smurf@smurf.noris.de> writes:\n> > >> we do not like 'Cristian new code' as a tag name.\n> > >\n> > > Duh? That's a perfectly valid tag name.\n> >\n> > Is it?\n> >\n> > $ man git-check-ref-format\n>\n> Bah, stupid me. You're right, obviously.\n>\n> I'll replace them with underscores. :-/\n\n-- \nDan Libby\n\nOpen Source Consulting\nSan Jose, Costa Rica\nhttp://osc.co.cr\nphone: 011 506 223 7382\nFax: 011 506 223 7359\n"}]}