{"thread":{"id":"15286","subject":"[PATCH] change Perl syntax to support Perl 5.6","startedAt":"2008-08-30T17:39:47Z","lastAt":"2008-09-05T06:34:51Z","messageCount":29,"participants":["Robert Schiele","Jeff King","Junio C Hamano","Jakub Narebski","Avery Pennarun","Randal L. Schwartz","Ask Bjørn Hansen","Petr Baudis","Jay Soffian","H. Peter Anvin","Tom G. Christensen","Alex Riesen","Brandon Casey"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"89226","messageId":"20080830173947.GF7185@schiele.dyndns.org","threadId":"15286","inReplyTo":null,"subject":"[PATCH] change Perl syntax to support Perl 5.6","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-08-30T17:39:47Z","receivedAt":"2008-08-30T17:39:47Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"git-add--interactive has one Perl command that was not yet present in\nPerl 5.6.  Changing this single command makes it compatible again.\n\nSigned-off-by: Robert Schiele <rschiele@gmail.com>\n---\nThis is an alternative to my previous patch that just declared Perl 5.8 to\nbe the required version.\n\n git-add--interactive.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex da768ee..777ec5f 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -61,7 +61,7 @@ sub run_cmd_pipe {\n \t\treturn qx{@args};\n \t} else {\n \t\tmy $fh = undef;\n-\t\topen($fh, '-|', @_) or die;\n+\t\topen($fh, '-|', join(' ', @_)) or die;\n \t\treturn <$fh>;\n \t}\n }\n-- \n1.5.4.5\n"},{"id":"89229","messageId":"20080830180022.GA14552@coredump.intra.peff.net","threadId":"15286","inReplyTo":"20080830173947.GF7185@schiele.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-08-30T18:00:22Z","receivedAt":"2008-08-30T18:00:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 30, 2008 at 07:39:47PM +0200, Robert Schiele wrote:\n\n> git-add--interactive has one Perl command that was not yet present in\n> Perl 5.6.  Changing this single command makes it compatible again.\n\nHaving read your other message, I know what it is about this command\nthat does not work with Perl 5.6. But probably it would be good to\nmention \"list form of three argument open with pipe\".\n\n>  git-add--interactive.perl |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n\nWhat about the similar uses in cvsimport, cvsserver, and gitweb? How\nabout the scripts in contrib (a quick grep reveals some fast-import\nscripts, blameview, cidaemon, continuous, and hooks/update-paranoid.\n\nMost of those things are not as \"core\" as add--interactive, so I am not\nopposed to changing just this one spot and documenting \"core can use\n5.6, but these other things need 5.8\".\n\n> -\t\topen($fh, '-|', @_) or die;\n> +\t\topen($fh, '-|', join(' ', @_)) or die;\n\nWon't this execute the command using the shell, which means that\nmetacharacters need to be escaped? I didn't try, but I'm pretty sure\nthis would break\n\n  git add -i \"file with space\"\n\n-Peff\n"},{"id":"89231","messageId":"7vwshygyy9.fsf@gitster.siamese.dyndns.org","threadId":"15286","inReplyTo":"20080830180022.GA14552@coredump.intra.peff.net","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-30T18:06:06Z","receivedAt":"2008-08-30T18:06:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Sat, Aug 30, 2008 at 07:39:47PM +0200, Robert Schiele wrote:\n>\n>> git-add--interactive has one Perl command that was not yet present in\n>> Perl 5.6.  Changing this single command makes it compatible again.\n>\n> Having read your other message, I know what it is about this command\n> that does not work with Perl 5.6. But probably it would be good to\n> mention \"list form of three argument open with pipe\".\n>\n>>  git-add--interactive.perl |    2 +-\n>>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> What about the similar uses in cvsimport, cvsserver, and gitweb? How\n> about the scripts in contrib (a quick grep reveals some fast-import\n> scripts, blameview, cidaemon, continuous, and hooks/update-paranoid.\n>\n> Most of those things are not as \"core\" as add--interactive, so I am not\n> opposed to changing just this one spot and documenting \"core can use\n> 5.6, but these other things need 5.8\".\n>\n>> -\t\topen($fh, '-|', @_) or die;\n>> +\t\topen($fh, '-|', join(' ', @_)) or die;\n>\n> Won't this execute the command using the shell, which means that\n> metacharacters need to be escaped? I didn't try, but I'm pretty sure\n> this would break\n>\n>   git add -i \"file with space\"\n\nI didn't try either but I think you are right.  And I agree we should say\nwe rely on 5.6 or newer.\n\nI thought gitweb folks are targetting 5.6.1 as the minimum for unicode\nsupport (Lea and Jakub Cc'ed)?\n"},{"id":"89232","messageId":"20080830181333.GA14893@coredump.intra.peff.net","threadId":"15286","inReplyTo":"7vwshygyy9.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-08-30T18:13:33Z","receivedAt":"2008-08-30T18:13:33Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 30, 2008 at 11:06:06AM -0700, Junio C Hamano wrote:\n\n> > Won't this execute the command using the shell, which means that\n> > metacharacters need to be escaped? I didn't try, but I'm pretty sure\n> > this would break\n> >\n> >   git add -i \"file with space\"\n> \n> I didn't try either but I think you are right.  And I agree we should say\n> we rely on 5.6 or newer.\n\nI did just try, and it is indeed broken.\n\n> I thought gitweb folks are targetting 5.6.1 as the minimum for unicode\n> support (Lea and Jakub Cc'ed)?\n\nHas it been tested? I don't have perl 5.6 handy, but:\n\n  $ man perl58delta | grep -A8 'list form of'\n       ·   If your platform supports fork(), you can use the list form of\n           \"open\" for pipes.  For example:\n\n               open KID_PS, \"-|\", \"ps\", \"aux\" or die $!;\n\n           forks the ps(1) command (without spawning a shell, as there are\n           more than three arguments to open()), and reads its standard output\n           via the \"KID_PS\" filehandle.  See perlipc.\n\n  $ grep -- '-|' gitweb/gitweb.perl | head\n        if (open my $fd, \"-|\", git_cmd(), \"rev-parse\", \"--verify\", \"HEAD\") {\n        open my $fd, \"-|\", git_cmd(), \"cat-file\", '-t', $hash or return;\n        open my $fh, \"-|\", git_cmd(), \"config\", '-z', '-l',\n        open my $fd, \"-|\", git_cmd(), \"ls-tree\", $base, \"--\", $path\n        open my $fd, \"-|\", git_cmd(), \"ls-tree\", '-r', '-t', '-z', $base\n        open($fd, \"-|\", git_cmd(), 'for-each-ref',\n        open my $fd, \"-|\", git_cmd(), \"show-ref\", \"--dereference\",\n        open my $fd, \"-|\", git_cmd(), \"name-rev\", \"--tags\", $hash\n        open my $fd, \"-|\", git_cmd(), \"cat-file\", \"tag\", $tag_id or return;\n        open my $fd, \"-|\", git_cmd(), \"rev-list\",\n\nSo either I am misunderstanding something, or gitweb uses a construct\nthat needs perl 5.8.\n\n-Peff\n"},{"id":"89233","messageId":"20080830183413.GG7185@schiele.dyndns.org","threadId":"15286","inReplyTo":"7vwshygyy9.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-08-30T18:34:13Z","receivedAt":"2008-08-30T18:34:13Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Sat, Aug 30, 2008 at 11:06:06AM -0700, Junio C Hamano wrote:\n> I didn't try either but I think you are right.  And I agree we should say\n> we rely on 5.6 or newer.\n\nIf we don't change it we need to rely on 5.8 or newer as my initial patch\nsuggested.\n\nIf there are problems with that change I recommend just using my initial patch\nchanging the documentation to require Perl 5.8 since my interest in Perl 5.6\nsupport is not big enough to mess around with quoting all that stuff.  If\nsomeone really needs this he or she can still do it --- it should be not too\ndifficult.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"89235","messageId":"20080830183949.GA16415@coredump.intra.peff.net","threadId":"15286","inReplyTo":"20080830183413.GG7185@schiele.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-08-30T18:39:50Z","receivedAt":"2008-08-30T18:39:50Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 30, 2008 at 08:34:13PM +0200, Robert Schiele wrote:\n\n> If there are problems with that change I recommend just using my\n> initial patch changing the documentation to require Perl 5.8 since my\n> interest in Perl 5.6 support is not big enough to mess around with\n> quoting all that stuff.  If someone really needs this he or she can\n> still do it --- it should be not too difficult.\n\nI think it is as simple as:\n\ndiff --git a/git-add--interactive.perl b/git-add--interactive.perl\nindex da768ee..4ee6f89 100755\n--- a/git-add--interactive.perl\n+++ b/git-add--interactive.perl\n@@ -61,7 +61,7 @@ sub run_cmd_pipe {\n \t\treturn qx{@args};\n \t} else {\n \t\tmy $fh = undef;\n-\t\topen($fh, '-|', @_) or die;\n+\t\topen($fh, '-|', join(' ', map { quotemeta($_) } @_)) or die;\n \t\treturn <$fh>;\n \t}\n }\n\nBut I didn't do any testing beyond checking that \"git add -i 'file with\nspaces'\" which was broken by your patch now works at all.\n\n-Peff\n"},{"id":"89248","messageId":"7v3akmgsqq.fsf@gitster.siamese.dyndns.org","threadId":"15286","inReplyTo":"20080830183413.GG7185@schiele.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-30T20:20:13Z","receivedAt":"2008-08-30T20:20:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Schiele <rschiele@gmail.com> writes:\n\n> On Sat, Aug 30, 2008 at 11:06:06AM -0700, Junio C Hamano wrote:\n>> I didn't try either but I think you are right.  And I agree we should say\n>> we rely on 5.6 or newer.\n>\n> If we don't change it we need to rely on 5.8 or newer as my initial patch\n> suggested.\n\nI think it should be as simple as Jeff's patch, and I think it is\nmoderately preferable to make sure the core part runs with earlier version\nthan punting.\n\nI however do not have 5.6 (or 5.6.1) installation handy, so I cannot test\nto make sure that Jeff's patch is the only necessary fix to the \"add -i\".\n"},{"id":"89251","messageId":"200808302237.17017.jnareb@gmail.com","threadId":"15286","inReplyTo":"20080830183949.GA16415@coredump.intra.peff.net","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-08-30T20:37:15Z","receivedAt":"2008-08-30T20:37:15Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sat, 30 August 2008, Jeff King wrote:\n> On Sat, Aug 30, 2008 at 08:34:13PM +0200, Robert Schiele wrote:\n> \n> > If there are problems with that change I recommend just using my\n> > initial patch changing the documentation to require Perl 5.8 since my\n> > interest in Perl 5.6 support is not big enough to mess around with\n> > quoting all that stuff.  If someone really needs this he or she can\n> > still do it --- it should be not too difficult.\n\nFirst, IIRC gitweb requires Perl 5.8 _anyway_ because of unicode stuff.\n\n> I think it is as simple as:\n> \n> diff --git a/git-add--interactive.perl b/git-add--interactive.perl\n> index da768ee..4ee6f89 100755\n> --- a/git-add--interactive.perl\n> +++ b/git-add--interactive.perl\n> @@ -61,7 +61,7 @@ sub run_cmd_pipe {\n>  \t\treturn qx{@args};\n>  \t} else {\n>  \t\tmy $fh = undef;\n> -\t\topen($fh, '-|', @_) or die;\n> +\t\topen($fh, '-|', join(' ', map { quotemeta($_) } @_)) or die;\n>  \t\treturn <$fh>;\n>  \t}\n>  }\n> \n> But I didn't do any testing beyond checking that \"git add -i 'file with\n> spaces'\" which was broken by your patch now works at all.\n\nNo, you would need something like this code from gitweb.perl (used in\nvery rare cases where list form of open cannot be used, which means\nwhen we need pipeline like for compressed snapshot, or redirecting\nstdout and/or stderr to /dev/null like when getting type of possibly\nnot existing object in git_object)\n\n # quote the given arguments for passing them to the shell\n # quote_command(\"command\", \"arg 1\", \"arg with ' and ! characters\")\n # => \"'command' 'arg 1' 'arg with '\\'' and '\\!' characters'\"\n # Try to avoid using this function wherever possible.\n sub quote_command {\n \treturn join(' ',\n \t\t    map( { my $a = $_; $a =~ s/(['!])/'\\\\$1'/g; \"'$a'\" } @_ ));\n }\n\n\nOr you can use \"open $fd, '-|'\" to fork, an \"manually\" exec/system.\n-- \nJakub Narebski\nPoland\n"},{"id":"89267","messageId":"20080830212117.GH7185@schiele.dyndns.org","threadId":"15286","inReplyTo":"200808302237.17017.jnareb@gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-08-30T21:21:17Z","receivedAt":"2008-08-30T21:21:17Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Sat, Aug 30, 2008 at 10:37:15PM +0200, Jakub Narebski wrote:\n>  # quote the given arguments for passing them to the shell\n>  # quote_command(\"command\", \"arg 1\", \"arg with ' and ! characters\")\n>  # => \"'command' 'arg 1' 'arg with '\\'' and '\\!' characters'\"\n>  # Try to avoid using this function wherever possible.\n>  sub quote_command {\n>  \treturn join(' ',\n>  \t\t    map( { my $a = $_; $a =~ s/(['!])/'\\\\$1'/g; \"'$a'\" } @_ ));\n>  }\n\nWell, I guess you know why I did not consider it worth from my side to go into\nthat business.  ;-)\n\nIf someone has a concrete implementation and a list of (concrete) tests I\nshould do I can do so.\n\nOtherwise I just consider Perl 5.6 as unsupported since our main development\nsystems have Perl 5.8 or later anyway.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"89285","messageId":"32541b130808302235g6a23efcfs78efe2ef557cd9c7@mail.gmail.com","threadId":"15286","inReplyTo":"200808302237.17017.jnareb@gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-08-31T05:35:31Z","receivedAt":"2008-08-31T05:35:31Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Sat, Aug 30, 2008 at 4:37 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> Or you can use \"open $fd, '-|'\" to fork, an \"manually\" exec/system.\n\nShell quoting is a disaster (including security holes, where relevant)\nwaiting to happen.  The above is the only sane way to do it, and it\nisn't very hard to implement.  (Instead of system() in the subprocess,\nyou can use exec().)\n\nHave fun,\n\nAvery\n"},{"id":"89317","messageId":"86abetnw7l.fsf@blue.stonehenge.com","threadId":"15286","inReplyTo":"20080830173947.GF7185@schiele.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2008-08-31T13:35:42Z","receivedAt":"2008-08-31T13:35:42Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Robert\" == Robert Schiele <rschiele@gmail.com> writes:\nRobert> -\t\topen($fh, '-|', @_) or die;\nRobert> +\t\topen($fh, '-|', join(' ', @_)) or die;\n\nNo.  This is dangerous.\n\nIf you want 5.6 equivalent code, you'll have to use something\nthat deals with the explicit fork() of open($fh, '-|').\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nSmalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.\nSee http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion\n"},{"id":"89316","messageId":"8663phnw3z.fsf@blue.stonehenge.com","threadId":"15286","inReplyTo":"32541b130808302235g6a23efcfs78efe2ef557cd9c7@mail.gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2008-08-31T13:37:52Z","receivedAt":"2008-08-31T13:37:52Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Avery\" == Avery Pennarun <apenwarr@gmail.com> writes:\n\nAvery> Shell quoting is a disaster (including security holes, where relevant)\nAvery> waiting to happen.  The above is the only sane way to do it, and it\nAvery> isn't very hard to implement.  (Instead of system() in the subprocess,\nAvery> you can use exec().)\n\nquotemeta() is about regex quoting.  This is not precisely the same as shell\nquoting, and is both misleading, and potentially broken.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nSmalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.\nSee http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion\n"},{"id":"89323","messageId":"7v63ph40at.fsf@gitster.siamese.dyndns.org","threadId":"15286","inReplyTo":"8663phnw3z.fsf@blue.stonehenge.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-31T16:27:38Z","receivedAt":"2008-08-31T16:27:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"merlyn@stonehenge.com (Randal L. Schwartz) writes:\n\n>>>>>> \"Avery\" == Avery Pennarun <apenwarr@gmail.com> writes:\n>\n> Avery> Shell quoting is a disaster (including security holes, where relevant)\n> Avery> waiting to happen.  The above is the only sane way to do it, and it\n> Avery> isn't very hard to implement.  (Instead of system() in the subprocess,\n> Avery> you can use exec().)\n>\n> quotemeta() is about regex quoting.  This is not precisely the same as shell\n> quoting, and is both misleading, and potentially broken.\n\nAgreed to, and grateful for, both of your comments.\n\nDo you like the one Jakub quoted from how gitweb does it?  It looks like\nthis:\n\n    # quote the given arguments for passing them to the shell\n    # quote_command(\"command\", \"arg 1\", \"arg with ' and ! characters\")\n    # => \"'command' 'arg 1' 'arg with '\\'' and '\\!' characters'\"\n    # Try to avoid using this function wherever possible.\n    sub quote_command {\n           return join(' ',\n                       map( { my $a = $_; $a =~ s/(['!])/'\\\\$1'/g; \"'$a'\" } @_ ));\n    }\n"},{"id":"89330","messageId":"32541b130808311129u79f4179enfabab8f5845ed522@mail.gmail.com","threadId":"15286","inReplyTo":"7v63ph40at.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-08-31T18:29:28Z","receivedAt":"2008-08-31T18:29:28Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Sun, Aug 31, 2008 at 12:27 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> merlyn@stonehenge.com (Randal L. Schwartz) writes:\n>\n>>>>>>> \"Avery\" == Avery Pennarun <apenwarr@gmail.com> writes:\n>>\n>> Avery> Shell quoting is a disaster (including security holes, where relevant)\n>> Avery> waiting to happen.  The above is the only sane way to do it, and it\n>> Avery> isn't very hard to implement.  (Instead of system() in the subprocess,\n>> Avery> you can use exec().)\n>>\n>> quotemeta() is about regex quoting.  This is not precisely the same as shell\n>> quoting, and is both misleading, and potentially broken.\n>\n> Agreed to, and grateful for, both of your comments.\n>\n> Do you like the one Jakub quoted from how gitweb does it?  It looks like\n> this:\n>\n>    # quote the given arguments for passing them to the shell\n>    # quote_command(\"command\", \"arg 1\", \"arg with ' and ! characters\")\n>    # => \"'command' 'arg 1' 'arg with '\\'' and '\\!' characters'\"\n>    # Try to avoid using this function wherever possible.\n>    sub quote_command {\n>           return join(' ',\n>                       map( { my $a = $_; $a =~ s/(['!])/'\\\\$1'/g; \"'$a'\" } @_ ));\n>    }\n\nNo, that's just another feeble attempt at quoting, which may or may\nnot be correct.  I'm not smart enough to tell.\n\nI have a proper implementation in the 'runlock' script in gitbuilder:\n\n    http://github.com/apenwarr/gitbuilder/tree/master/runlock\n\nIn that particular case, I wanted to handle signals carefully, so I\nneeded the manual fork thing even in perl 5.8.  You can safely remove\nthe signal handling stuff (and of course the lockfile stuff) if you\njust want a minimal safe fork-exec-wait implementation in perl.\n\nHave fun,\n\nAvery\n"},{"id":"89335","messageId":"53906E21-DE02-4C85-8CC0-4E4AC53AE130@develooper.com","threadId":"15286","inReplyTo":"20080830173947.GF7185@schiele.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Ask Bjørn Hansen","fromEmail":"ask@develooper.com","sentAt":"2008-08-31T19:54:42Z","receivedAt":"2008-08-31T19:54:42Z","isPatch":true,"sender":{"key":"ask@develooper.com","avatar":"https://gravatar.com/avatar/05ce68433216df7d04bb0d82b7d93b11957e2137e6ed23c4b5bc061d78635f2f?d=mp&s=160"},"body":"\nOn Aug 30, 2008, at 10:39, Robert Schiele wrote:\n\n> git-add--interactive has one Perl command that was not yet present in\n> Perl 5.6.  Changing this single command makes it compatible again.\n\nPerl 5.8.0 was released six years ago.  Perl 5.6.0 was released in  \n*2000*.  I think we can safely tell people to get with the program and  \nuse Perl 5.8.\n\n> This is an alternative to my previous patch that just declared Perl  \n> 5.8 to\n> be the required version.\n\n\n+1 to that one.\n\n\n  - ask\n\n-- \nhttp://develooper.com/ - http://askask.com/\n"},{"id":"89338","messageId":"200808312223.38222.jnareb@gmail.com","threadId":"15286","inReplyTo":"32541b130808311129u79f4179enfabab8f5845ed522@mail.gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-08-31T20:23:36Z","receivedAt":"2008-08-31T20:23:36Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sub, 31 August 2008, Avery Pennarun wrote:\n> On Sun, Aug 31, 2008 at 12:27 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> merlyn@stonehenge.com (Randal L. Schwartz) writes:\n>>\n>>>>>>>> \"Avery\" == Avery Pennarun <apenwarr@gmail.com> writes:\n>>>\n>>> Avery> Shell quoting is a disaster (including security holes, where relevant)\n>>> Avery> waiting to happen.  The above is the only sane way to do it, and it\n>>> Avery> isn't very hard to implement.  (Instead of system() in the subprocess,\n>>> Avery> you can use exec().)\n>>>\n>>> quotemeta() is about regex quoting.  This is not precisely the same as shell\n>>> quoting, and is both misleading, and potentially broken.\n>>\n>> Agreed to, and grateful for, both of your comments.\n>>\n>> Do you like the one Jakub quoted from how gitweb does it?  It looks like\n>> this:\n>>\n>>    # quote the given arguments for passing them to the shell\n>>    # quote_command(\"command\", \"arg 1\", \"arg with ' and ! characters\")\n>>    # => \"'command' 'arg 1' 'arg with '\\'' and '\\!' characters'\"\n>>    # Try to avoid using this function wherever possible.\n>>    sub quote_command {\n>>           return join(' ',\n>>                       map( { my $a = $_; $a =~ s/(['!])/'\\\\$1'/g; \"'$a'\" } @_ ));\n>>    }\n> \n> No, that's just another feeble attempt at quoting, which may or may\n> not be correct.  I'm not smart enough to tell.\n\nFirst, according to POSIX, for POSIX-compatibile shells we should have:\n\n 2. Shell Command Language\n 2.2 Quoting\n 2.2.2 Single-Quotes\n\n Enclosing characters in single-quotes ( '' ) shall preserve the literal\n value of each character within the single-quotes. A single-quote cannot\n occur within single-quotes.\n\nhttp://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_02_02\n\nSo that is why single quote \"'\" must be escaped as \"I'am\" -> 'I'\\''am'\n(' -> '\\'', i.e. close quote, escaped ' = \\', (re-)open quote).\n\n\nSecond, as Lea Wrote in commit message for 516381d5:\n\n    gitweb: quote commands properly when calling the shell\n    \n    This eliminates the function git_cmd_str, which was used for composing\n    command lines, and adds a quote_command function, which quotes all of\n    its arguments (as in quote.c).\n\nWe have to go to quote.c to get to know why \"!\" is a special case too,\nin addition to \"'\".  The commit message for 77d604c3 (by H. Peter Anvin,\nwhich is CC-ed) states:\n\n    Create function to sq_quote into a buffer\n    Handle !'s for csh-based shells\n\n> I have a proper implementation in the 'runlock' script in gitbuilder:\n> \n>     http://github.com/apenwarr/gitbuilder/tree/master/runlock\n> \n> In that particular case, I wanted to handle signals carefully, so I\n> needed the manual fork thing even in perl 5.8.  You can safely remove\n> the signal handling stuff (and of course the lockfile stuff) if you\n> just want a minimal safe fork-exec-wait implementation in perl.\n\nBut if we go this way, i.e. fork+exec (perhaps implicit fork), why do\nnot simply use appropriate commands from Git.pm (Git::Repo doesn't\nhave it yet, IIRC).  As far as I remember Git.pm was created initially\nto unify all different \"safe_pipe\" and \"safe_cmd\" implementations among\ndifferent Perl scripts in Git (Petr \"Pasky\" Baudis CC-ed).\n\n-- \nJakub Narebski\nPoland\n"},{"id":"89339","messageId":"20080831203427.GF10360@machine.or.cz","threadId":"15286","inReplyTo":"200808312223.38222.jnareb@gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-08-31T20:34:27Z","receivedAt":"2008-08-31T20:34:27Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sun, Aug 31, 2008 at 10:23:36PM +0200, Jakub Narebski wrote:\n> On Sub, 31 August 2008, Avery Pennarun wrote:\n> > I have a proper implementation in the 'runlock' script in gitbuilder:\n> > \n> >     http://github.com/apenwarr/gitbuilder/tree/master/runlock\n> > \n> > In that particular case, I wanted to handle signals carefully, so I\n> > needed the manual fork thing even in perl 5.8.  You can safely remove\n> > the signal handling stuff (and of course the lockfile stuff) if you\n> > just want a minimal safe fork-exec-wait implementation in perl.\n> \n> But if we go this way, i.e. fork+exec (perhaps implicit fork), why do\n> not simply use appropriate commands from Git.pm (Git::Repo doesn't\n> have it yet, IIRC).  As far as I remember Git.pm was created initially\n> to unify all different \"safe_pipe\" and \"safe_cmd\" implementations among\n> different Perl scripts in Git (Petr \"Pasky\" Baudis CC-ed).\n\nCan anyone give a concrete justification for Perl 5.6 support? Who is\nneeding it and why do they have to use Perl 5.6? Does it offset the time\nspent discussing and reviewing this and the maintenance burden of extra\ncomplicated code?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nThe next generation of interesting software will be done\non the Macintosh, not the IBM PC.  -- Bill Gates\n"},{"id":"89341","messageId":"200808312255.16943.jnareb@gmail.com","threadId":"15286","inReplyTo":"200808312223.38222.jnareb@gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-08-31T20:55:15Z","receivedAt":"2008-08-31T20:55:15Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jakub Narebski wrote:\n\n> We have to go to quote.c to get to know why \"!\" is a special case too,\n> in addition to \"'\".  The commit message for 77d604c3 (by H. Peter Anvin,\n> which is CC-ed) states:\n> \n>     Create function to sq_quote into a buffer\n>     Handle !'s for csh-based shells\n\nAlthough according to POSIX \n\n  Enclosing characters in single-quotes ( '' ) shall preserve the literal\n  value of each character within the single-quotes. A single-quote cannot\n  occur within single-quotes.\n\nso \"!\" should be not treated as special character in POSIX shell,\ncsh unfortunately does not follow this.  Try\n\n  $ echo '!!'\n\nin csh, tcsh (now that's funny) and bash (or dash).\n\n-- \nJakub Narebski\nPoland\n"},{"id":"89353","messageId":"7vljyc1wzg.fsf@gitster.siamese.dyndns.org","threadId":"15286","inReplyTo":"53906E21-DE02-4C85-8CC0-4E4AC53AE130@develooper.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-01T01:22:11Z","receivedAt":"2008-09-01T01:22:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ask Bjørn Hansen <ask@develooper.com> writes:\n\n> On Aug 30, 2008, at 10:39, Robert Schiele wrote:\n>\n>> git-add--interactive has one Perl command that was not yet present in\n>> Perl 5.6.  Changing this single command makes it compatible again.\n>\n> Perl 5.8.0 was released six years ago.  Perl 5.6.0 was released in\n> *2000*.  I think we can safely tell people to get with the program and\n> use Perl 5.8.\n>\n>> This is an alternative to my previous patch that just declared Perl\n>> 5.8 to\n>> be the required version.\n>\n> +1 to that one.\n\nNow, would somebody volunteer to go everywhere our user base (who no\nlonger read Release Notes) hang around, post a message saying that some\npeople on git development list are proposing to drop Perl 5.6 support, and\nif the proposal goes ahead, it is possible that the next release may force\nupgrading Perl for them, to make sure they won't complain saying they've\nnever heard about the \"incompatible change\" beforehand?\n"},{"id":"89355","messageId":"7vhc901vs5.fsf@gitster.siamese.dyndns.org","threadId":"15286","inReplyTo":"7vljyc1wzg.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-01T01:48:10Z","receivedAt":"2008-09-01T01:48:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Ask Bjørn Hansen <ask@develooper.com> writes:\n> ...\n>>> This is an alternative to my previous patch that just declared Perl\n>>> 5.8 to\n>>> be the required version.\n>>\n>> +1 to that one.\n>\n> Now, would somebody volunteer to go everywhere our user base (who no\n> longer read Release Notes) hang around, post a message saying that some\n> people on git development list are proposing to drop Perl 5.6 support, and\n> if the proposal goes ahead, it is possible that the next release may force\n> upgrading Perl for them, to make sure they won't complain saying they've\n> never heard about the \"incompatible change\" beforehand?\n\nJust in case before anybody overreacts without reading the mailing list\nbacklog; the above is meant to be a moderately bitter joke ;-)\n\nI tend to think that everybody who needs to run git in their development\nenvironment (the deployment site could be running with ancient Perl for\nall we care --- after all, git or any SCM is primarily to be run in the\ndevelopment environment, and even if people use git to transfer the end\nresult from the development side, all they need is the really core part of\nhistory tranfer tools like fetch, push and checkout on the deployed site;\nthese tools do not depend on Perl) would be running 5.8 by now.  Granted,\nsome development machine need to have the exact same version of everything\nas the intended deployment environment for testing purposes, and some\npeople may be developing a piece of software that is meant to run on Perl\nthat is no more recent than 5.6, but with virtual machines and all, I\nthink it would be rare to have such a setup --- it is a lot easier to\ndevelop on a platform with more reasonably recent Perl that your\ndevelopment tools (not limited to git itself) may depend on, and test on a\nvirtual bochs with an ancient software configuration as the intended\ndeployment site.\n\nSo I personally think it is probably Ok to declare that we do depend on\n5.8.\n"},{"id":"89356","messageId":"76718490808311852n6d6d138ch7bbf5605c6cf7c18@mail.gmail.com","threadId":"15286","inReplyTo":"32541b130808302235g6a23efcfs78efe2ef557cd9c7@mail.gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2008-09-01T01:52:20Z","receivedAt":"2008-09-01T01:52:20Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sun, Aug 31, 2008 at 1:35 AM, Avery Pennarun <apenwarr@gmail.com> wrote:\n> On Sat, Aug 30, 2008 at 4:37 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n>> Or you can use \"open $fd, '-|'\" to fork, an \"manually\" exec/system.\n>\n> Shell quoting is a disaster (including security holes, where relevant)\n> waiting to happen.  The above is the only sane way to do it, and it\n> isn't very hard to implement.  (Instead of system() in the subprocess,\n> you can use exec().)\n\nThe perlipc man page has example routines. Search for \"safe backtick\"\nand/or \"safe pipe\".\n\nj.\n"},{"id":"89360","messageId":"48BB683F.6020308@zytor.com","threadId":"15286","inReplyTo":"20080831203427.GF10360@machine.or.cz","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2008-09-01T03:57:51Z","receivedAt":"2008-09-01T03:57:51Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Petr Baudis wrote:\n> \n> Can anyone give a concrete justification for Perl 5.6 support? Who is\n> needing it and why do they have to use Perl 5.6? Does it offset the time\n> spent discussing and reviewing this and the maintenance burden of extra\n> complicated code?\n> \n\nI believe RHEL4 is Perl 5.6.1, but I could be wrong.\n\n\t-hpa\n"},{"id":"89361","messageId":"20080901042249.GI7185@schiele.dyndns.org","threadId":"15286","inReplyTo":"48BB683F.6020308@zytor.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Robert Schiele","fromEmail":"rschiele@gmail.com","sentAt":"2008-09-01T04:22:50Z","receivedAt":"2008-09-01T04:22:50Z","isPatch":true,"sender":{"key":"rschiele@gmail.com","avatar":"https://gravatar.com/avatar/409473567eb2287d5f0157b51f5b703994b347f24f92172e3a0588741c27a492?d=mp&s=160"},"body":"On Sun, Aug 31, 2008 at 08:57:51PM -0700, H. Peter Anvin wrote:\n> I believe RHEL4 is Perl 5.6.1, but I could be wrong.\n\nNo, that's 5.8.5.  RHEL3 is 5.8.0.  RHEL2 is what you are talking about.\n\nRobert\n\n-- \nRobert Schiele\nDipl.-Wirtsch.informatiker\tmailto:rschiele@gmail.com\n\n\"Quidquid latine dictum sit, altum sonatur.\"\n"},{"id":"89414","messageId":"48BBE8E7.5020001@statsbiblioteket.dk","threadId":"15286","inReplyTo":"20080901042249.GI7185@schiele.dyndns.org","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Tom G. Christensen","fromEmail":"tgc@statsbiblioteket.dk","sentAt":"2008-09-01T13:06:47Z","receivedAt":"2008-09-01T13:06:47Z","isPatch":true,"sender":{"key":"tgc@statsbiblioteket.dk","avatar":"https://avatars.githubusercontent.com/u/912180?v=4"},"body":"Robert Schiele wrote:\n> On Sun, Aug 31, 2008 at 08:57:51PM -0700, H. Peter Anvin wrote:\n>> I believe RHEL4 is Perl 5.6.1, but I could be wrong.\n> \n> No, that's 5.8.5.  RHEL3 is 5.8.0.  RHEL2 is what you are talking about.\n> \nIndeed. RHEL 2.1 will be supported by Redhat until May 31, 2009 so has\nabout 9 months of support life left.\nIt is probably also the last still supported Linux dist with perl 5.6.x.\n\nOn RHEL 2.1 git 1.6.0.1 currently builds fine and it passes the\ntestsuite except for the tests using --interactive.\n\n-tgc\n"},{"id":"89445","messageId":"20080901214254.GA8058@blimp.localhost","threadId":"15286","inReplyTo":"32541b130808302235g6a23efcfs78efe2ef557cd9c7@mail.gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2008-09-01T21:42:54Z","receivedAt":"2008-09-01T21:42:54Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Avery Pennarun, Sun, Aug 31, 2008 07:35:31 +0200:\n> On Sat, Aug 30, 2008 at 4:37 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> > Or you can use \"open $fd, '-|'\" to fork, an \"manually\" exec/system.\n> \n> Shell quoting is a disaster (including security holes, where relevant)\n> waiting to happen.  The above is the only sane way to do it, and it\n> isn't very hard to implement. ...\n\nexcept on Windows, where it is impossible to implement.\n"},{"id":"89464","messageId":"32541b130809011723l1cd8abfid9228363f952875@mail.gmail.com","threadId":"15286","inReplyTo":"20080901214254.GA8058@blimp.localhost","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-09-02T00:23:52Z","receivedAt":"2008-09-02T00:23:52Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Mon, Sep 1, 2008 at 5:42 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n> Avery Pennarun, Sun, Aug 31, 2008 07:35:31 +0200:\n>> On Sat, Aug 30, 2008 at 4:37 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n>> > Or you can use \"open $fd, '-|'\" to fork, an \"manually\" exec/system.\n>>\n>> Shell quoting is a disaster (including security holes, where relevant)\n>> waiting to happen.  The above is the only sane way to do it, and it\n>> isn't very hard to implement. ...\n>\n> except on Windows, where it is impossible to implement.\n\nTrue.  Although every program parses its own options on Windows, so\nproper, safe quoting is *also* impossible to implement.\n\nAvery\n"},{"id":"89517","messageId":"32541b130809021050g22a7cb0blfde151844e6e8851@mail.gmail.com","threadId":"15286","inReplyTo":"32541b130809011723l1cd8abfid9228363f952875@mail.gmail.com","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-09-02T17:50:38Z","receivedAt":"2008-09-02T17:50:38Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Mon, Sep 1, 2008 at 8:23 PM, Avery Pennarun <apenwarr@gmail.com> wrote:\n> On Mon, Sep 1, 2008 at 5:42 PM, Alex Riesen <raa.lkml@gmail.com> wrote:\n>> Avery Pennarun, Sun, Aug 31, 2008 07:35:31 +0200:\n>>> On Sat, Aug 30, 2008 at 4:37 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n>>> > Or you can use \"open $fd, '-|'\" to fork, an \"manually\" exec/system.\n>>>\n>>> Shell quoting is a disaster (including security holes, where relevant)\n>>> waiting to happen.  The above is the only sane way to do it, and it\n>>> isn't very hard to implement. ...\n>>\n>> except on Windows, where it is impossible to implement.\n>\n> True.  Although every program parses its own options on Windows, so\n> proper, safe quoting is *also* impossible to implement.\n\nHmm, furthermore, perl seems to implement the \"-|\" operation just fine\non Windows.  I'm not really sure what it does, but it works.  Try the\nattached perl script with the following command sequence.  (It works\non cygwin bash, but that might be magic; try it from cmd.exe instead\nif you really want to reassure yourself.)\n\n    echo >\"foo blah\"\n    dir foo blah\n         # above gives an error\n    dir \"foo blah\"\n         # above works\n    c:\\perl\\bin\\perl test.pl cmd /c dir \"foo blah\"\n         # above works\n\nTested with ActiveState perl 5.6.1 (fails as \"-|\" is apparently not\nsupported *at all*, but maybe that's only on Windows), Cygwin perl\n5.8.8 (works fine), and msysgit's perl 5.8.8 (works fine).\n\nNow, as you can see above, the only copy of perl 5.6.x that I have\n*didn't* work with this test, but it's on Windows, where I suspect\nthat version is just broken.  It says:\n\n   '-' is not recognized as an internal or external command, operable\nprogram or batch file.\n\nYou might then suspect that perhaps perl 5.6.1 didn't support the\nopen($fh, \"-|\") syntax at all, but 'perldoc perlipc' even on my\nActiveState perl 5.6.1 documents the feature.  Thus, I think it's\n*just* the (obsolete) ActiveState version on Windows that has a buggy\nimplementation.  I would appreciate if someone with perl 5.6 on Linux\ncould try the program below with the commands above and see if it\nworks.\n\nAs another side note, the ActiveState perl *does* work if you call\nfork() instead of open($fh, \"-|\"), but of course that doesn't redirect\nstdin/stdout of the called process.  So perl on Windows *does*\ncorrectly fake the fork/exec part.\n\ntest.pl follows.\n\nHave fun,\n\nAvery\n\nP.S. Congratulations to the msysgit people for providing the only\nversion of msys perl that I could figure out how to install.\n\n\n#!/usr/bin/perl -w\nuse strict;\n\nif (@ARGV < 1) {\n    print STDERR \"Usage: $0 <command line...>\\n\";\n    exit 127;\n}\n\nprint \"Arguments:\\n{\", join(\"}\\n{\", @ARGV), \"}\\n\\n\";\n\nmy $pid = open my $fh, \"-|\";\nif ($pid) {\n    # parent\n    while (<$fh>) {\n        s/\\r?\\n$//;\n        chomp;\n        print \"[$_]\\n\";\n    }\n    my $newpid = waitpid($pid, 0);\n    if ($newpid != $pid) {\n        die(\"waitpid returned '$newpid', expected '$pid'\\n\");\n    }\t\n    my $ret = $?;\n    exit $? >> 8;\n} else {\n    # child\n    exec(@ARGV);\n}\n\n# NOTREACHED\n"},{"id":"89774","messageId":"fUNB92Q2XygkBhhleaxyWUGW8Ecwa-lU403JuDrY0JMrT1kmsFkWwg@cipher.nrlssc.navy.mil","threadId":"15286","inReplyTo":"48BBE8E7.5020001@statsbiblioteket.dk","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-09-04T17:28:30Z","receivedAt":"2008-09-04T17:28:30Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Tom G. Christensen wrote:\n\n> On RHEL 2.1 git 1.6.0.1 currently builds fine and it passes the\n> testsuite except for the tests using --interactive.\n\nEven t9700-perl-git.sh? Or perhaps it is skipped since Test::More\nis missing?\n\nt9700-perl-git.sh doesn't run successfully for me on perl 5.8.0 without\nchanges since test.pl uses\n\n    'File::Temp->new()'\n\nobject form, and\n\n    'open our $tmpstderr, \">&\", STDERR'\n\nbare STDERR as 3rd argument which this perl version complains about.\n\n-brandon\n"},{"id":"89829","messageId":"48C0D30B.4030302@statsbiblioteket.dk","threadId":"15286","inReplyTo":"fUNB92Q2XygkBhhleaxyWUGW8Ecwa-lU403JuDrY0JMrT1kmsFkWwg@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] change Perl syntax to support Perl 5.6","fromName":"Tom G. Christensen","fromEmail":"tgc@statsbiblioteket.dk","sentAt":"2008-09-05T06:34:51Z","receivedAt":"2008-09-05T06:34:51Z","isPatch":true,"sender":{"key":"tgc@statsbiblioteket.dk","avatar":"https://avatars.githubusercontent.com/u/912180?v=4"},"body":"Brandon Casey wrote:\n> Tom G. Christensen wrote:\n> \n>> On RHEL 2.1 git 1.6.0.1 currently builds fine and it passes the\n>> testsuite except for the tests using --interactive.\n> \n> Even t9700-perl-git.sh? Or perhaps it is skipped since Test::More\n> is missing?\n> \nExactly.\n\n> t9700-perl-git.sh doesn't run successfully for me on perl 5.8.0 without\n> changes since test.pl uses\n> \n>     'File::Temp->new()'\n> \n> object form, and\n> \n>     'open our $tmpstderr, \">&\", STDERR'\n> \n> bare STDERR as 3rd argument which this perl version complains about.\n> \nI saw your patch for this.\nI haven't got this far with 5.8.0 since t9100-git-svn-basic.sh kills the \nbuild because of File::Temp->new() in Git.pm.\n\n-tgc\n"}]}