{"thread":{"id":"15317","subject":"Git 1.6.0.1 breaks git-svn with perl 5.8.0","startedAt":"2008-09-01T09:27:59Z","lastAt":"2008-09-10T15:11:15Z","messageCount":23,"participants":["Tom G. Christensen","Matthieu Moy","Abhijit Menon-Sen","Junio C Hamano","Marcus Griep","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"89380","messageId":"48BBB59F.9080204@statsbiblioteket.dk","threadId":"15317","inReplyTo":null,"subject":"Git 1.6.0.1 breaks git-svn with perl 5.8.0","fromName":"Tom G. Christensen","fromEmail":"tgc@statsbiblioteket.dk","sentAt":"2008-09-01T09:27:59Z","receivedAt":"2008-09-01T09:27:59Z","isPatch":false,"sender":{"key":"tgc@statsbiblioteket.dk","avatar":"https://avatars.githubusercontent.com/u/912180?v=4"},"body":"The problem is that Git.pm depends on the \"new\" method of File::Temp \nintroduced in 0.14.\nperl 5.8.0 only has File::Temp 0.13 while 0.14 was included with 5.8.1 \nand later.\nThe breakage was introduced in this commit:\ne41352b24e29eba43d00a3fd117befaef1d594bc\n\n-tgc\n\nmock-chroot> ./t9100-git-svn-basic.sh -i -v\nInitialized empty Git repository in \n/builddir/build/BUILD/git-1.6.0.1/t/trash directory/.git/\n* define NO_SVN_TESTS to skip git-svn tests\n* expecting success:\n         mkdir import &&\n         cd import &&\n         echo foo > foo &&\n         ln -s foo foo.link\n         mkdir -p dir/a/b/c/d/e &&\n         echo \"deep dir\" > dir/a/b/c/d/e/file &&\n         mkdir bar &&\n         echo \"zzz\" > bar/zzz &&\n         echo \"#!/bin/sh\" > exec.sh &&\n         chmod +x exec.sh &&\n         svn import -m \"import for git-svn\" . \"$svnrepo\" >/dev/null &&\n         cd .. &&\n         rm -rf import &&\n         git-svn init \"$svnrepo\"\nParentheses missing around \"my\" list at \n/builddir/build/BUILD/git-1.6.0.1/t/../git-svn line 4387.\n*   ok 1: initialize git-svn\n\n* expecting success: git-svn fetch\nParentheses missing around \"my\" list at \n/builddir/build/BUILD/git-1.6.0.1/t/../git-svn line 4387.\nCan't locate object method \"new\" via package \"File::Temp\" at \n/builddir/build/BUILD/git-1.6.0.1/t/../perl/blib/lib/Git.pm line 1024.\n\n* FAIL 2: import an SVN revision into git\n         git-svn fetch\nmock-chroot> exit\n"},{"id":"89386","messageId":"vpqvdxggpw6.fsf@bauges.imag.fr","threadId":"15317","inReplyTo":"48BBB59F.9080204@statsbiblioteket.dk","subject":"Re: Git 1.6.0.1 breaks git-svn with perl 5.8.0","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-09-01T09:46:17Z","receivedAt":"2008-09-01T09:46:17Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"\"Tom G. Christensen\" <tgc@statsbiblioteket.dk> writes:\n\n> The problem is that Git.pm depends on the \"new\" method of File::Temp\n> introduced in 0.14.\n> perl 5.8.0 only has File::Temp 0.13 while 0.14 was included with 5.8.1\n> and later.\n> The breakage was introduced in this commit:\n> e41352b24e29eba43d00a3fd117befaef1d594bc\n\nIsn't that fixed by c14c8ceb13b299892f286757e22e6af4f6cffab5 ?\n(Git.pm: Make File::Spec and File::Temp requirement lazy, a few\ncommits before 1.6.0)\n\n-- \nMatthieu\n"},{"id":"89388","messageId":"20080901100435.GC6555@toroid.org","threadId":"15317","inReplyTo":"vpqvdxggpw6.fsf@bauges.imag.fr","subject":"[PATCH] Git.pm: Require File::Temp 0.14 for new()","fromName":"Abhijit Menon-Sen","fromEmail":"ams@toroid.org","sentAt":"2008-09-01T10:04:35Z","receivedAt":"2008-09-01T10:04:35Z","isPatch":true,"sender":{"key":"ams@toroid.org","avatar":null},"body":"File::Temp->new() was introduced in File::Temp 0.14, but 5.8.0 shipped\nwith File::Temp 0.13, as pointed out by Tom G. Christensen. Since the\ndependency is optional anyway, we can require 0.14.\n\nSigned-off-by: Abhijit Menon-Sen <ams@toroid.org>\n---\n\nAt 2008-09-01 11:46:17 +0200, Matthieu.Moy@imag.fr wrote:\n>\n> > The problem is that Git.pm depends on the \"new\" method of File::Temp\n> > introduced in 0.14. [...]\n> \n> Isn't that fixed by c14c8ceb13b299892f286757e22e6af4f6cffab5 ?\n> (Git.pm: Make File::Spec and File::Temp requirement lazy, a few\n> commits before 1.6.0)\n\nNo, because _verify_require only checks that File::Temp exists, not that\nFile::Temp 0.14 exists. This patch fixes that.\n\n-- ams\n\n perl/Git.pm |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 102e6a4..4e901b6 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -1032,7 +1032,10 @@ sub _temp_cache {\n }\n \n sub _verify_require {\n-\teval { require File::Temp; require File::Spec; };\n+\teval {\n+            require File::Spec;\n+            require File::Temp; File::Temp->VERSION(0.14);\n+        };\n \t$@ and throw Error::Simple($@);\n }\n \n-- \n1.6.0.49.gea35\n"},{"id":"89391","messageId":"48BBC060.6080809@statsbiblioteket.dk","threadId":"15317","inReplyTo":"vpqvdxggpw6.fsf@bauges.imag.fr","subject":"Re: Git 1.6.0.1 breaks git-svn with perl 5.8.0","fromName":"Tom G. Christensen","fromEmail":"tgc@statsbiblioteket.dk","sentAt":"2008-09-01T10:13:52Z","receivedAt":"2008-09-01T10:13:52Z","isPatch":false,"sender":{"key":"tgc@statsbiblioteket.dk","avatar":"https://avatars.githubusercontent.com/u/912180?v=4"},"body":"Matthieu Moy wrote:\n> \"Tom G. Christensen\" <tgc@statsbiblioteket.dk> writes:\n> \n>> The problem is that Git.pm depends on the \"new\" method of File::Temp\n>> introduced in 0.14.\n>> perl 5.8.0 only has File::Temp 0.13 while 0.14 was included with 5.8.1\n>> and later.\n>> The breakage was introduced in this commit:\n>> e41352b24e29eba43d00a3fd117befaef1d594bc\n> \n> Isn't that fixed by c14c8ceb13b299892f286757e22e6af4f6cffab5 ?\n> (Git.pm: Make File::Spec and File::Temp requirement lazy, a few\n> commits before 1.6.0)\n> \nI don't see how it is relevant.\nIt does not remove the implicit requirement on File::Temp > 0.13.\n\n-tgc\n"},{"id":"89394","messageId":"48BBC20E.20808@statsbiblioteket.dk","threadId":"15317","inReplyTo":"20080901100435.GC6555@toroid.org","subject":"Re: [PATCH] Git.pm: Require File::Temp 0.14 for new()","fromName":"Tom G. Christensen","fromEmail":"tgc@statsbiblioteket.dk","sentAt":"2008-09-01T10:21:02Z","receivedAt":"2008-09-01T10:21:02Z","isPatch":true,"sender":{"key":"tgc@statsbiblioteket.dk","avatar":"https://avatars.githubusercontent.com/u/912180?v=4"},"body":"Abhijit Menon-Sen wrote:\n> File::Temp->new() was introduced in File::Temp 0.14, but 5.8.0 shipped\n> with File::Temp 0.13, as pointed out by Tom G. Christensen. Since the\n> dependency is optional anyway, we can require 0.14.\n> \nIMHO not acceptable since RHEL3 users will not be able to use git-svn \nanymore.\nWouldn't it be possible to accomplish the same as File::Temp->New with \nthe old File::Temp?\n\n-tgc\n"},{"id":"89402","messageId":"20080901104222.GA10026@toroid.org","threadId":"15317","inReplyTo":"48BBC20E.20808@statsbiblioteket.dk","subject":"[PATCH] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Abhijit Menon-Sen","fromEmail":"ams@toroid.org","sentAt":"2008-09-01T10:42:22Z","receivedAt":"2008-09-01T10:42:22Z","isPatch":true,"sender":{"key":"ams@toroid.org","avatar":null},"body":"Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\ninterface introduced in 0.14, as pointed out by Tom G. Christensen.\n\nSigned-off-by: Abhijit Menon-Sen <ams@toroid.org>\n---\n\nAt 2008-09-01 12:21:02 +0200, tgc@statsbiblioteket.dk wrote:\n>\n> Wouldn't it be possible to accomplish the same as File::Temp->New with\n> the old File::Temp?\n\nOK, does this one work for you?\n\n-- ams\n\n perl/Git.pm |   11 +++++++----\n 1 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 102e6a4..f383ff8 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -1021,10 +1021,13 @@ sub _temp_cache {\n \t\t\tcarp \"Temp file '\", $name,\n \t\t\t\t\"' was closed. Opening replacement.\";\n \t\t}\n-\t\t$$temp_fd = File::Temp->new(\n-\t\t\tTEMPLATE => 'Git_XXXXXX',\n-\t\t\tDIR => File::Spec->tmpdir\n-\t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n+\t\teval {\n+\t\t\t($$temp_fd) = File::Temp->tempfile(\n+\t\t\t\t'Git_XXXXXX',\n+\t\t\t\tDIR => File::Spec->tmpdir\n+\t\t\t);\n+\t\t};\n+\t\tthrow Error::Simple(\"couldn't open new temp file\") if $@;\n \t\t$$temp_fd->autoflush;\n \t\tbinmode $$temp_fd;\n \t}\n-- \n1.6.0.1.161.g7f314\n"},{"id":"89406","messageId":"48BBCBEA.8000301@statsbiblioteket.dk","threadId":"15317","inReplyTo":"20080901104222.GA10026@toroid.org","subject":"Re: [PATCH] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Tom G. Christensen","fromEmail":"tgc@statsbiblioteket.dk","sentAt":"2008-09-01T11:03:06Z","receivedAt":"2008-09-01T11:03:06Z","isPatch":true,"sender":{"key":"tgc@statsbiblioteket.dk","avatar":"https://avatars.githubusercontent.com/u/912180?v=4"},"body":"Abhijit Menon-Sen wrote:\n> Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\n> interface introduced in 0.14, as pointed out by Tom G. Christensen.\n> \n> Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>\n> ---\n> \n> At 2008-09-01 12:21:02 +0200, tgc@statsbiblioteket.dk wrote:\n>> Wouldn't it be possible to accomplish the same as File::Temp->New with\n>> the old File::Temp?\n> \n> OK, does this one work for you?\n> \nNope.\nI applied it to 1.6.0.1 and now get this error instead:\n\nParentheses missing around \"my\" list at \n/builddir/build/BUILD/git-1.6.0.1/t/../git-svn line 4387.\nAttempt to release temp file '' that has not been locked at \n/builddir/build/BUILD/git-1.6.0.1/t/../git-svn line 3294\nCan't call method \"opened\" on an undefined value at \n/builddir/build/BUILD/git-1.6.0.1/t/../perl/blib/lib/Git.pm line 1001.\n\n-tgc\n"},{"id":"89944","messageId":"7vskscplsz.fsf@gitster.siamese.dyndns.org","threadId":"15317","inReplyTo":"48BBCBEA.8000301@statsbiblioteket.dk","subject":"Re: [PATCH] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-07T05:27:56Z","receivedAt":"2008-09-07T05:27:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Tom G. Christensen\" <tgc@statsbiblioteket.dk> writes:\n\n> Abhijit Menon-Sen wrote:\n>> Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\n>> interface introduced in 0.14, as pointed out by Tom G. Christensen.\n>>\n>> Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>\n>> ---\n>>\n>> At 2008-09-01 12:21:02 +0200, tgc@statsbiblioteket.dk wrote:\n>>> Wouldn't it be possible to accomplish the same as File::Temp->New with\n>>> the old File::Temp?\n>>\n>> OK, does this one work for you?\n>>\n> Nope.\n\nSomebody involved in this thread care to report the current status please?\n"},{"id":"89962","messageId":"20080907092624.GA8470@toroid.org","threadId":"15317","inReplyTo":"7vskscplsz.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Abhijit Menon-Sen","fromEmail":"ams@toroid.org","sentAt":"2008-09-07T09:26:24Z","receivedAt":"2008-09-07T09:26:24Z","isPatch":true,"sender":{"key":"ams@toroid.org","avatar":null},"body":"At 2008-09-06 22:27:56 -0700, gitster@pobox.com wrote:\n>\n> Somebody involved in this thread care to report the current status\n> please?\n\nMy patch is broken. I sent Tom an update, but he encountered an error\nwith that too. I'm trying to figure out what's wrong, and will post a\nnew patch to the list when I have it working.\n\n-- ams\n"},{"id":"89979","messageId":"48C40670.6090106@gmail.com","threadId":"15317","inReplyTo":"20080907092624.GA8470@toroid.org","subject":"Re: [PATCH] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Marcus Griep","fromEmail":"neoeinstein@gmail.com","sentAt":"2008-09-07T16:50:56Z","receivedAt":"2008-09-07T16:50:56Z","isPatch":true,"sender":{"key":"neoeinstein@gmail.com","avatar":"https://gravatar.com/avatar/75d467077b37e56699d408fb97545e9a92a2907ff1feea4ba3a4b861f7cb7af4?d=mp&s=160"},"body":"Abhijit Menon-Sen wrote:\n> My patch is broken. I sent Tom an update, but he encountered an error\n> with that too. I'm trying to figure out what's wrong, and will post a\n> new patch to the list when I have it working.\n\nAs I was the one who brought File::Temp->new over from git-svn, I can\ntake a look at reducing the dependency to ->tempfile.  If you don't patch\nin first, I'll get one in as well.\n\n-- \nMarcus Griep\nGPG Key ID: 0x5E968152\n——\nhttp://www.boohaunt.net\nאת.ψο´\n\n"},{"id":"90058","messageId":"20080908080548.GA3206@toroid.org","threadId":"15317","inReplyTo":"48C40670.6090106@gmail.com","subject":"Re: [PATCH] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Abhijit Menon-Sen","fromEmail":"ams@toroid.org","sentAt":"2008-09-08T08:05:48Z","receivedAt":"2008-09-08T08:05:48Z","isPatch":true,"sender":{"key":"ams@toroid.org","avatar":null},"body":"At 2008-09-07 12:50:56 -0400, neoeinstein@gmail.com wrote:\n>\n> As I was the one who brought File::Temp->new over from git-svn, I can\n> take a look at reducing the dependency to ->tempfile.  If you don't\n> patch in first, I'll get one in as well.\n\nPlease do.\n\nHere's my latest patch, in case you find it useful as a starting point.\nI do not have more time or inclination to work on this at the moment.\nThe problem with this patch is that the caller (git-svn in this case)\nassumes that a File::Temp object will be returned, and depends on the\nOO interface (e.g. by calling $tmp_fh->filename).\n\nUnfortunately, I do not think the problem is limited to filename(). I\nblessed $$temp_fd into a stub package that provided a fake filename()\nmethod, but t9100-git-svn-basic.sh failed a little further on, and I\ndid not investigate further. Anyway, I don't think emulating the\nFile::Temp OO interface is a good solution at all.\n\n(Tom: I'm sorry I ran out of energy before I could put together a\ncomplete fix for you.)\n\n-- ams\n\nFrom: Abhijit Menon-Sen <ams@toroid.org>\nDate: Mon, 8 Sep 2008 12:26:59 +0530\nSubject: [PATCH] Git.pm: Use File::Temp->tempfile instead of ->new\n\nPerl 5.8.0 ships with File::Temp 0.13, which does not have the new()\ninterface introduced in 0.14, as pointed out by Tom G. Christensen.\n\nSigned-off-by: Abhijit Menon-Sen <ams@toroid.org>\n---\n perl/Git.pm |   13 ++++++++-----\n 1 files changed, 8 insertions(+), 5 deletions(-)\n\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 102e6a4..b0498ca 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -991,7 +991,7 @@ the same string.\n sub temp_release {\n \tmy ($self, $temp_fd, $trunc) = _maybe_self(@_);\n \n-\tif (ref($temp_fd) ne 'File::Temp') {\n+\tif (exists $TEMP_FILES{$temp_fd}) {\n \t\t$temp_fd = $TEMP_FILES{$temp_fd};\n \t}\n \tunless ($TEMP_LOCKS{$temp_fd}) {\n@@ -1021,10 +1021,13 @@ sub _temp_cache {\n \t\t\tcarp \"Temp file '\", $name,\n \t\t\t\t\"' was closed. Opening replacement.\";\n \t\t}\n-\t\t$$temp_fd = File::Temp->new(\n-\t\t\tTEMPLATE => 'Git_XXXXXX',\n-\t\t\tDIR => File::Spec->tmpdir\n-\t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n+\t\teval {\n+\t\t\t($$temp_fd) = File::Temp->tempfile(\n+\t\t\t\t'Git_XXXXXX',\n+\t\t\t\tDIR => File::Spec->tmpdir\n+\t\t\t);\n+\t\t};\n+\t\tthrow Error::Simple(\"couldn't open new temp file\") if $@;\n \t\t$$temp_fd->autoflush;\n \t\tbinmode $$temp_fd;\n \t}\n-- \n1.6.0.1.196.g01914\n"},{"id":"90096","messageId":"1220889063-20387-1-git-send-email-marcus@griep.us","threadId":"15317","inReplyTo":"20080908080548.GA3206@toroid.org","subject":"[PATCH] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Marcus Griep","fromEmail":"marcus@griep.us","sentAt":"2008-09-08T15:51:03Z","receivedAt":"2008-09-08T15:51:03Z","isPatch":true,"sender":{"key":"marcus@griep.us","avatar":"https://gravatar.com/avatar/0a841f2aad3f9a38c9bcf87a567c2a1751cb08924bae1bc46ee171395bcf9794?d=mp&s=160"},"body":"Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\ninterface introduced in 0.14, as pointed out by Tom G. Christensen.\n\nThis modifies Git.pm to use the more established tempfile() interface\nand updates 'git svn' to match.\n\nSigned-off-by: Marcus Griep <marcus@griep.us>\n---\n\n Per the earlier patch versions by Abhijit Menon-Sen and Tom G. Christensen.\n Both of you may want to run a test and add your 'Tested-by' to the thread\n if everything works out before Eric Wong adds his 'Acked-by'.\n\n git-svn.perl |    4 ++--\n perl/Git.pm  |   29 +++++++++++++++++++++++------\n 2 files changed, 25 insertions(+), 8 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ee3f5ed..a6d75db 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3304,7 +3304,7 @@ sub close_file {\n \t\t\t\t\tmy $out = syswrite($tmp_fh, $str, $res);\n \t\t\t\t\tdefined($out) && $out == $res\n \t\t\t\t\t\tor croak(\"write \",\n-\t\t\t\t\t\t\t$tmp_fh->filename,\n+\t\t\t\t\t\t\tGit::temp_filename($tmp_fh),\n \t\t\t\t\t\t\t\": $!\\n\");\n \t\t\t\t}\n \t\t\t\tdefined $res or croak $!;\n@@ -3315,7 +3315,7 @@ sub close_file {\n \t\t}\n \n \t\t$hash = $::_repository->hash_and_insert_object(\n-\t\t\t\t$fh->filename);\n+\t\t\t\tGit::temp_filename($fh));\n \t\t$hash =~ /^[a-f\\d]{40}$/ or die \"not a sha1: $hash\\n\";\n \n \t\tGit::temp_release($fb->{base}, 1);\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 102e6a4..3ea3fb2 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -937,7 +937,7 @@ sub _close_cat_blob {\n \n { # %TEMP_* Lexical Context\n \n-my (%TEMP_LOCKS, %TEMP_FILES);\n+my (%TEMP_LOCKS, %TEMP_FILES, %TEMP_FILENAMES);\n \n =item temp_acquire ( NAME )\n \n@@ -991,7 +991,7 @@ the same string.\n sub temp_release {\n \tmy ($self, $temp_fd, $trunc) = _maybe_self(@_);\n \n-\tif (ref($temp_fd) ne 'File::Temp') {\n+\tif (exists $TEMP_FILES{$temp_fd}) {\n \t\t$temp_fd = $TEMP_FILES{$temp_fd};\n \t}\n \tunless ($TEMP_LOCKS{$temp_fd}) {\n@@ -1021,12 +1021,12 @@ sub _temp_cache {\n \t\t\tcarp \"Temp file '\", $name,\n \t\t\t\t\"' was closed. Opening replacement.\";\n \t\t}\n-\t\t$$temp_fd = File::Temp->new(\n-\t\t\tTEMPLATE => 'Git_XXXXXX',\n-\t\t\tDIR => File::Spec->tmpdir\n-\t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n+\t\tmy $fname;\n+\t\t($$temp_fd, $fname) = File::Temp->tempfile('Git_XXXXXX')\n+\t\t\tor throw Error::Simple(\"couldn't open new temp file\");\n \t\t$$temp_fd->autoflush;\n \t\tbinmode $$temp_fd;\n+\t\t$TEMP_FILENAMES{$$temp_fd} = $fname;\n \t}\n \t$$temp_fd;\n }\n@@ -1053,6 +1053,23 @@ sub temp_reset {\n \t\tor throw Error::Simple(\"expected file position to be reset\");\n }\n \n+=item temp_filename ( NAME )\n+\n+=item temp_filename ( FILEHANDLE )\n+\n+Returns the filenae associated with the given tempfile.\n+\n+=cut\n+\n+sub temp_filename {\n+\tmy ($self, $temp_fd) = _maybe_self(@_);\n+\n+\tif (exists $TEMP_FILES{$temp_fd}) {\n+\t\t$temp_fd = $TEMP_FILES{$temp_fd};\n+\t}\n+\t$TEMP_FILENAMES{$temp_fd};\n+}\n+\n sub END {\n \tunlink values %TEMP_FILES if %TEMP_FILES;\n }\n-- \n1.6.0.1.400.gd2470\n"},{"id":"90104","messageId":"1220892781-24343-1-git-send-email-marcus@griep.us","threadId":"15317","inReplyTo":"1220889063-20387-1-git-send-email-marcus@griep.us","subject":"[PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Marcus Griep","fromEmail":"marcus@griep.us","sentAt":"2008-09-08T16:53:01Z","receivedAt":"2008-09-08T16:53:01Z","isPatch":true,"sender":{"key":"marcus@griep.us","avatar":"https://gravatar.com/avatar/0a841f2aad3f9a38c9bcf87a567c2a1751cb08924bae1bc46ee171395bcf9794?d=mp&s=160"},"body":"Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\ninterface introduced in 0.14, as pointed out by Tom G. Christensen.\n\nThis modifies Git.pm to use the more established tempfile() interface\nand updates 'git svn' to match.\n\nSigned-off-by: Marcus Griep <marcus@griep.us>\n---\n\n This patch v2 cleans up a few code items, corrects a misspelling,\n and ensures that the temp file gets unlinked when we exit, now\n that we are requesting the filename.  Otherwise, the previous\n comments stand:\n \n Per the earlier patch versions by Abhijit Menon-Sen and Tom G. Christensen.\n Both of you may want to run a test and add your 'Tested-by' to the thread\n if everything works out before Eric Wong adds his 'Acked-by'.\n\n git-svn.perl |    4 ++--\n perl/Git.pm  |   42 ++++++++++++++++++++++++++++++------------\n 2 files changed, 32 insertions(+), 14 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ee3f5ed..c92bd8e 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3304,7 +3304,7 @@ sub close_file {\n \t\t\t\t\tmy $out = syswrite($tmp_fh, $str, $res);\n \t\t\t\t\tdefined($out) && $out == $res\n \t\t\t\t\t\tor croak(\"write \",\n-\t\t\t\t\t\t\t$tmp_fh->filename,\n+\t\t\t\t\t\t\tGit::temp_fname($tmp_fh),\n \t\t\t\t\t\t\t\": $!\\n\");\n \t\t\t\t}\n \t\t\t\tdefined $res or croak $!;\n@@ -3315,7 +3315,7 @@ sub close_file {\n \t\t}\n \n \t\t$hash = $::_repository->hash_and_insert_object(\n-\t\t\t\t$fh->filename);\n+\t\t\t\tGit::temp_fname($fh));\n \t\t$hash =~ /^[a-f\\d]{40}$/ or die \"not a sha1: $hash\\n\";\n \n \t\tGit::temp_release($fb->{base}, 1);\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 102e6a4..3f5514c 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -58,7 +58,7 @@ require Exporter;\n                 command_bidi_pipe command_close_bidi_pipe\n                 version exec_path hash_object git_cmd_try\n                 remote_refs\n-                temp_acquire temp_release temp_reset);\n+                temp_acquire temp_release temp_reset temp_fname);\n \n \n =head1 DESCRIPTION\n@@ -937,7 +937,7 @@ sub _close_cat_blob {\n \n { # %TEMP_* Lexical Context\n \n-my (%TEMP_LOCKS, %TEMP_FILES);\n+my (%TEMP_FILEMAP, %TEMP_FILES);\n \n =item temp_acquire ( NAME )\n \n@@ -965,7 +965,7 @@ sub temp_acquire {\n \n \tmy $temp_fd = _temp_cache($name);\n \n-\t$TEMP_LOCKS{$temp_fd} = 1;\n+\t$TEMP_FILES{$temp_fd}{locked} = 1;\n \t$temp_fd;\n }\n \n@@ -991,16 +991,16 @@ the same string.\n sub temp_release {\n \tmy ($self, $temp_fd, $trunc) = _maybe_self(@_);\n \n-\tif (ref($temp_fd) ne 'File::Temp') {\n+\tif (exists $TEMP_FILEMAP{$temp_fd}) {\n \t\t$temp_fd = $TEMP_FILES{$temp_fd};\n \t}\n-\tunless ($TEMP_LOCKS{$temp_fd}) {\n+\tunless ($TEMP_FILES{$temp_fd}{locked}) {\n \t\tcarp \"Attempt to release temp file '\",\n \t\t\t$temp_fd, \"' that has not been locked\";\n \t}\n \ttemp_reset($temp_fd) if $trunc and $temp_fd->opened;\n \n-\t$TEMP_LOCKS{$temp_fd} = 0;\n+\t$TEMP_FILES{$temp_fd}{locked} = 0;\n \tundef;\n }\n \n@@ -1009,9 +1009,9 @@ sub _temp_cache {\n \n \t_verify_require();\n \n-\tmy $temp_fd = \\$TEMP_FILES{$name};\n+\tmy $temp_fd = \\$TEMP_FILEMAP{$name};\n \tif (defined $$temp_fd and $$temp_fd->opened) {\n-\t\tif ($TEMP_LOCKS{$$temp_fd}) {\n+\t\tif ($TEMP_FILES{$$temp_fd}{locked}) {\n \t\t\tthrow Error::Simple(\"Temp file with moniker '\",\n \t\t\t\t$name, \"' already in use\");\n \t\t}\n@@ -1021,12 +1021,13 @@ sub _temp_cache {\n \t\t\tcarp \"Temp file '\", $name,\n \t\t\t\t\"' was closed. Opening replacement.\";\n \t\t}\n-\t\t$$temp_fd = File::Temp->new(\n-\t\t\tTEMPLATE => 'Git_XXXXXX',\n-\t\t\tDIR => File::Spec->tmpdir\n+\t\tmy $fname;\n+\t\t($$temp_fd, $fname) = File::Temp->tempfile(\n+\t\t\t'Git_XXXXXX', UNLINK => 1\n \t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n \t\t$$temp_fd->autoflush;\n \t\tbinmode $$temp_fd;\n+\t\t$TEMP_FILES{$$temp_fd}{fname} = $fname;\n \t}\n \t$$temp_fd;\n }\n@@ -1053,8 +1054,25 @@ sub temp_reset {\n \t\tor throw Error::Simple(\"expected file position to be reset\");\n }\n \n+=item temp_fname ( NAME )\n+\n+=item temp_fname ( FILEHANDLE )\n+\n+Returns the filename associated with the given tempfile.\n+\n+=cut\n+\n+sub temp_fname {\n+\tmy ($self, $temp_fd) = _maybe_self(@_);\n+\n+\tif (exists $TEMP_FILEMAP{$temp_fd}) {\n+\t\t$temp_fd = $TEMP_FILEMAP{$temp_fd};\n+\t}\n+\t$TEMP_FILES{$temp_fd}{fname};\n+}\n+\n sub END {\n-\tunlink values %TEMP_FILES if %TEMP_FILES;\n+\tunlink values %TEMP_FILEMAP if %TEMP_FILEMAP;\n }\n \n } # %TEMP_* Lexical Context\n-- \n1.6.0.1.400.gd2470\n"},{"id":"90157","messageId":"20080909015338.GA15974@yp-box.dyndns.org","threadId":"15317","inReplyTo":"1220892781-24343-1-git-send-email-marcus@griep.us","subject":"Re: [PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-09-09T01:53:38Z","receivedAt":"2008-09-09T01:53:38Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Marcus Griep <marcus@griep.us> wrote:\n> Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\n> interface introduced in 0.14, as pointed out by Tom G. Christensen.\n> \n> This modifies Git.pm to use the more established tempfile() interface\n> and updates 'git svn' to match.\n> \n> Signed-off-by: Marcus Griep <marcus@griep.us>\n> ---\n> \n>  This patch v2 cleans up a few code items, corrects a misspelling,\n>  and ensures that the temp file gets unlinked when we exit, now\n>  that we are requesting the filename.  Otherwise, the previous\n>  comments stand:\n>  \n>  Per the earlier patch versions by Abhijit Menon-Sen and Tom G. Christensen.\n>  Both of you may want to run a test and add your 'Tested-by' to the thread\n>  if everything works out before Eric Wong adds his 'Acked-by'.\n\nThanks Marcus, this works for me.\n(Perl 5.10.0, so no compatibility issues).\n\n<bikeshed>\nCan we rename temp_fname() to temp_path(), though?  \"fname\"\njust doesn't look right in the API to me...\n</bikeshed>\n\n>  git-svn.perl |    4 ++--\n>  perl/Git.pm  |   42 ++++++++++++++++++++++++++++++------------\n>  2 files changed, 32 insertions(+), 14 deletions(-)\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index ee3f5ed..c92bd8e 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -3304,7 +3304,7 @@ sub close_file {\n>  \t\t\t\t\tmy $out = syswrite($tmp_fh, $str, $res);\n>  \t\t\t\t\tdefined($out) && $out == $res\n>  \t\t\t\t\t\tor croak(\"write \",\n> -\t\t\t\t\t\t\t$tmp_fh->filename,\n> +\t\t\t\t\t\t\tGit::temp_fname($tmp_fh),\n>  \t\t\t\t\t\t\t\": $!\\n\");\n>  \t\t\t\t}\n>  \t\t\t\tdefined $res or croak $!;\n> @@ -3315,7 +3315,7 @@ sub close_file {\n>  \t\t}\n>  \n>  \t\t$hash = $::_repository->hash_and_insert_object(\n> -\t\t\t\t$fh->filename);\n> +\t\t\t\tGit::temp_fname($fh));\n>  \t\t$hash =~ /^[a-f\\d]{40}$/ or die \"not a sha1: $hash\\n\";\n>  \n>  \t\tGit::temp_release($fb->{base}, 1);\n> diff --git a/perl/Git.pm b/perl/Git.pm\n> index 102e6a4..3f5514c 100644\n> --- a/perl/Git.pm\n> +++ b/perl/Git.pm\n> @@ -58,7 +58,7 @@ require Exporter;\n>                  command_bidi_pipe command_close_bidi_pipe\n>                  version exec_path hash_object git_cmd_try\n>                  remote_refs\n> -                temp_acquire temp_release temp_reset);\n> +                temp_acquire temp_release temp_reset temp_fname);\n>  \n>  \n>  =head1 DESCRIPTION\n> @@ -937,7 +937,7 @@ sub _close_cat_blob {\n>  \n>  { # %TEMP_* Lexical Context\n>  \n> -my (%TEMP_LOCKS, %TEMP_FILES);\n> +my (%TEMP_FILEMAP, %TEMP_FILES);\n>  \n>  =item temp_acquire ( NAME )\n>  \n> @@ -965,7 +965,7 @@ sub temp_acquire {\n>  \n>  \tmy $temp_fd = _temp_cache($name);\n>  \n> -\t$TEMP_LOCKS{$temp_fd} = 1;\n> +\t$TEMP_FILES{$temp_fd}{locked} = 1;\n>  \t$temp_fd;\n>  }\n>  \n> @@ -991,16 +991,16 @@ the same string.\n>  sub temp_release {\n>  \tmy ($self, $temp_fd, $trunc) = _maybe_self(@_);\n>  \n> -\tif (ref($temp_fd) ne 'File::Temp') {\n> +\tif (exists $TEMP_FILEMAP{$temp_fd}) {\n>  \t\t$temp_fd = $TEMP_FILES{$temp_fd};\n>  \t}\n> -\tunless ($TEMP_LOCKS{$temp_fd}) {\n> +\tunless ($TEMP_FILES{$temp_fd}{locked}) {\n>  \t\tcarp \"Attempt to release temp file '\",\n>  \t\t\t$temp_fd, \"' that has not been locked\";\n>  \t}\n>  \ttemp_reset($temp_fd) if $trunc and $temp_fd->opened;\n>  \n> -\t$TEMP_LOCKS{$temp_fd} = 0;\n> +\t$TEMP_FILES{$temp_fd}{locked} = 0;\n>  \tundef;\n>  }\n>  \n> @@ -1009,9 +1009,9 @@ sub _temp_cache {\n>  \n>  \t_verify_require();\n>  \n> -\tmy $temp_fd = \\$TEMP_FILES{$name};\n> +\tmy $temp_fd = \\$TEMP_FILEMAP{$name};\n>  \tif (defined $$temp_fd and $$temp_fd->opened) {\n> -\t\tif ($TEMP_LOCKS{$$temp_fd}) {\n> +\t\tif ($TEMP_FILES{$$temp_fd}{locked}) {\n>  \t\t\tthrow Error::Simple(\"Temp file with moniker '\",\n>  \t\t\t\t$name, \"' already in use\");\n>  \t\t}\n> @@ -1021,12 +1021,13 @@ sub _temp_cache {\n>  \t\t\tcarp \"Temp file '\", $name,\n>  \t\t\t\t\"' was closed. Opening replacement.\";\n>  \t\t}\n> -\t\t$$temp_fd = File::Temp->new(\n> -\t\t\tTEMPLATE => 'Git_XXXXXX',\n> -\t\t\tDIR => File::Spec->tmpdir\n> +\t\tmy $fname;\n> +\t\t($$temp_fd, $fname) = File::Temp->tempfile(\n> +\t\t\t'Git_XXXXXX', UNLINK => 1\n>  \t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n>  \t\t$$temp_fd->autoflush;\n>  \t\tbinmode $$temp_fd;\n> +\t\t$TEMP_FILES{$$temp_fd}{fname} = $fname;\n>  \t}\n>  \t$$temp_fd;\n>  }\n> @@ -1053,8 +1054,25 @@ sub temp_reset {\n>  \t\tor throw Error::Simple(\"expected file position to be reset\");\n>  }\n>  \n> +=item temp_fname ( NAME )\n> +\n> +=item temp_fname ( FILEHANDLE )\n> +\n> +Returns the filename associated with the given tempfile.\n> +\n> +=cut\n> +\n> +sub temp_fname {\n> +\tmy ($self, $temp_fd) = _maybe_self(@_);\n> +\n> +\tif (exists $TEMP_FILEMAP{$temp_fd}) {\n> +\t\t$temp_fd = $TEMP_FILEMAP{$temp_fd};\n> +\t}\n> +\t$TEMP_FILES{$temp_fd}{fname};\n> +}\n> +\n>  sub END {\n> -\tunlink values %TEMP_FILES if %TEMP_FILES;\n> +\tunlink values %TEMP_FILEMAP if %TEMP_FILEMAP;\n>  }\n>  \n>  } # %TEMP_* Lexical Context\n> -- \n> 1.6.0.1.400.gd2470\n"},{"id":"90161","messageId":"20080909020605.GA19190@toroid.org","threadId":"15317","inReplyTo":"1220892781-24343-1-git-send-email-marcus@griep.us","subject":"Re: [PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Abhijit Menon-Sen","fromEmail":"ams@toroid.org","sentAt":"2008-09-09T02:06:05Z","receivedAt":"2008-09-09T02:06:05Z","isPatch":true,"sender":{"key":"ams@toroid.org","avatar":null},"body":"At 2008-09-08 12:53:01 -0400, marcus@griep.us wrote:\n>\n> +\t\tmy $fname;\n> +\t\t($$temp_fd, $fname) = File::Temp->tempfile(\n> +\t\t\t'Git_XXXXXX', UNLINK => 1\n>  \t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n\nWhat happens when tempfile croaks on error?\n\n-- ams\n"},{"id":"90178","messageId":"48C628AA.4020100@statsbiblioteket.dk","threadId":"15317","inReplyTo":"1220892781-24343-1-git-send-email-marcus@griep.us","subject":"Re: [PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Tom G. Christensen","fromEmail":"tgc@statsbiblioteket.dk","sentAt":"2008-09-09T07:41:30Z","receivedAt":"2008-09-09T07:41:30Z","isPatch":true,"sender":{"key":"tgc@statsbiblioteket.dk","avatar":"https://avatars.githubusercontent.com/u/912180?v=4"},"body":"Marcus Griep wrote:\n> Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\n> interface introduced in 0.14, as pointed out by Tom G. Christensen.\n> \n> This modifies Git.pm to use the more established tempfile() interface\n> and updates 'git svn' to match.\n> \n> Signed-off-by: Marcus Griep <marcus@griep.us>\n> ---\n> \n>  This patch v2 cleans up a few code items, corrects a misspelling,\n>  and ensures that the temp file gets unlinked when we exit, now\n>  that we are requesting the filename.  Otherwise, the previous\n>  comments stand:\n> \n>  Per the earlier patch versions by Abhijit Menon-Sen and Tom G. Christensen.\n>  Both of you may want to run a test and add your 'Tested-by' to the thread\n>  if everything works out before Eric Wong adds his 'Acked-by'.\n> \nThe testsuite now passes t9100-git-svn-basic.sh and instead fails at \nt9108-git-svn-glob.sh but this appears to be unrelated to the File::Temp \nissue.\n\n--- expect.three        2008-09-09 07:34:39.000000000 +0000\n+++ stderr.three        2008-09-09 07:34:42.000000000 +0000\n@@ -1,2 +1,3 @@\n+Parentheses missing around \"my\" list at \n/home/tgc/projects/git/t/../git-svn line 4429.\n  Only one set of wildcard directories (e.g. '*' or '*/*/*') is \nsupported: 'branches/*/t/*'\n\n* FAIL 3: test disallow multi-globs\n\nTested-by: Tom G. Christensen <tgc@statsbiblioteket.dk>\n\n-tgc\n"},{"id":"90241","messageId":"48C6B3F0.505@griep.us","threadId":"15317","inReplyTo":"20080909020605.GA19190@toroid.org","subject":"Re: [PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Marcus Griep","fromEmail":"marcus@griep.us","sentAt":"2008-09-09T17:35:44Z","receivedAt":"2008-09-09T17:35:44Z","isPatch":true,"sender":{"key":"marcus@griep.us","avatar":"https://gravatar.com/avatar/0a841f2aad3f9a38c9bcf87a567c2a1751cb08924bae1bc46ee171395bcf9794?d=mp&s=160"},"body":"Abhijit Menon-Sen wrote:\n> At 2008-09-08 12:53:01 -0400, marcus@griep.us wrote:\n>> +\t\tmy $fname;\n>> +\t\t($$temp_fd, $fname) = File::Temp->tempfile(\n>> +\t\t\t'Git_XXXXXX', UNLINK => 1\n>>  \t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n> \n> What happens when tempfile croaks on error?\n\nI was indifferent to the idea of catching the ->tempfile croak just to hide it in our\nown error (since the ->tempfile croak would have more information), in which case the\nextra 'or throw' may be superfluous, but I kept it as a defensive programming practice.\n\n-- \nMarcus Griep\nGPG Key ID: 0x5E968152\n——\nhttp://www.boohaunt.net\nאת.ψο´\n\n"},{"id":"90243","messageId":"48C6B886.7020108@griep.us","threadId":"15317","inReplyTo":"48C628AA.4020100@statsbiblioteket.dk","subject":"Re: [PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Marcus Griep","fromEmail":"marcus@griep.us","sentAt":"2008-09-09T17:55:18Z","receivedAt":"2008-09-09T17:55:18Z","isPatch":true,"sender":{"key":"marcus@griep.us","avatar":"https://gravatar.com/avatar/0a841f2aad3f9a38c9bcf87a567c2a1751cb08924bae1bc46ee171395bcf9794?d=mp&s=160"},"body":"Tom G. Christensen wrote:\n> The testsuite now passes t9100-git-svn-basic.sh and instead fails at\n> t9108-git-svn-glob.sh but this appears to be unrelated to the File::Temp\n> issue.\n> \n> --- expect.three        2008-09-09 07:34:39.000000000 +0000\n> +++ stderr.three        2008-09-09 07:34:42.000000000 +0000\n> @@ -1,2 +1,3 @@\n> +Parentheses missing around \"my\" list at\n> /home/tgc/projects/git/t/../git-svn line 4429.\n>  Only one set of wildcard directories (e.g. '*' or '*/*/*') is\n> supported: 'branches/*/t/*'\n> \n> * FAIL 3: test disallow multi-globs\n\nIt's probably another back-portability issue (It's not failing in my testsuite).\nHowever, I think that I know the offending line.  Can you give me the text of\nyour line 4429 in git-svn and I'll submit a separate patch to fix that back\nportability issue.\n\n-- \nMarcus Griep\nGPG Key ID: 0x5E968152\n——\nhttp://www.boohaunt.net\nאת.ψο´\n\n"},{"id":"90308","messageId":"7vwshkzmfv.fsf@gitster.siamese.dyndns.org","threadId":"15317","inReplyTo":"20080909015338.GA15974@yp-box.dyndns.org","subject":"Re: [PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-10T03:53:08Z","receivedAt":"2008-09-10T03:53:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Marcus Griep <marcus@griep.us> wrote:\n>> Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\n>> interface introduced in 0.14, as pointed out by Tom G. Christensen.\n>> \n>> This modifies Git.pm to use the more established tempfile() interface\n>> and updates 'git svn' to match.\n>> \n>> Signed-off-by: Marcus Griep <marcus@griep.us>\n>> ---\n>> \n>>  This patch v2 cleans up a few code items, corrects a misspelling,\n>>  and ensures that the temp file gets unlinked when we exit, now\n>>  that we are requesting the filename.  Otherwise, the previous\n>>  comments stand:\n>>  \n>>  Per the earlier patch versions by Abhijit Menon-Sen and Tom G. Christensen.\n>>  Both of you may want to run a test and add your 'Tested-by' to the thread\n>>  if everything works out before Eric Wong adds his 'Acked-by'.\n>\n> Thanks Marcus, this works for me.\n> (Perl 5.10.0, so no compatibility issues).\n>\n> <bikeshed>\n> Can we rename temp_fname() to temp_path(), though?  \"fname\"\n> just doesn't look right in the API to me...\n> </bikeshed>\n\nOk, so will you take the patch with bikeshed fixes and feed the result to\nme with a pull-request, or shall I do that myself?  I do not mind doing\nthis either way --- just trying to avoid duplicated work.\n\nThis is a 'maint' material, right?\n"},{"id":"90322","messageId":"48C7745F.1070008@statsbiblioteket.dk","threadId":"15317","inReplyTo":"48C6B886.7020108@griep.us","subject":"Re: [PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Tom G. Christensen","fromEmail":"tgc@statsbiblioteket.dk","sentAt":"2008-09-10T07:16:47Z","receivedAt":"2008-09-10T07:16:47Z","isPatch":true,"sender":{"key":"tgc@statsbiblioteket.dk","avatar":"https://avatars.githubusercontent.com/u/912180?v=4"},"body":"Marcus Griep wrote:\n> Tom G. Christensen wrote:\n>> The testsuite now passes t9100-git-svn-basic.sh and instead fails at\n>> t9108-git-svn-glob.sh but this appears to be unrelated to the File::Temp\n>> issue.\n>>\n>> --- expect.three        2008-09-09 07:34:39.000000000 +0000\n>> +++ stderr.three        2008-09-09 07:34:42.000000000 +0000\n>> @@ -1,2 +1,3 @@\n>> +Parentheses missing around \"my\" list at\n>> /home/tgc/projects/git/t/../git-svn line 4429.\n>>  Only one set of wildcard directories (e.g. '*' or '*/*/*') is\n>> supported: 'branches/*/t/*'\n>>\n>> * FAIL 3: test disallow multi-globs\n> \n> It's probably another back-portability issue (It's not failing in my testsuite).\n> However, I think that I know the offending line.  Can you give me the text of\n> your line 4429 in git-svn and I'll submit a separate patch to fix that back\n> portability issue.\n> \ngit-svn:4429:\n         pipe my $rfd, my $wfd or return;\n\nI know next to nothing about perl but I put () around my, my and then \nthe test passes.\n\nHowever it now fails in t9700/test.pl:\nt9700 $ ./test.pl -i -v\nok 1 - use Git;\nBareword \"STDERR\" not allowed while \"strict subs\" in use at ./test.pl \nline 38.\nExecution of ./test.pl aborted due to compilation errors.\n1..1\n# Looks like your test died just after 1.\n\nBrandon Casey already posted a patch for this that also fixes the use of \nFile::Temp->New in t9700/test.pl:\nhttp://article.gmane.org/gmane.comp.version-control.git/92791\nApplying it allowed a full a run of the testsuite to complete without error.\n\n'/bin/sh' ./aggregate-results.sh test-results/t*-*\nfixed   1\nsuccess 3709\nfailed  0\nbroken  2\ntotal   3712\n\n-tgc\n"},{"id":"90340","messageId":"20080910100958.GE13085@hand.yhbt.net","threadId":"15317","inReplyTo":"7vwshkzmfv.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH v2] Git.pm: Use File::Temp->tempfile instead of ->new","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-09-10T10:09:58Z","receivedAt":"2008-09-10T10:09:58Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> \n> > Marcus Griep <marcus@griep.us> wrote:\n> >> Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()\n> >> interface introduced in 0.14, as pointed out by Tom G. Christensen.\n> >> \n> >> This modifies Git.pm to use the more established tempfile() interface\n> >> and updates 'git svn' to match.\n> >> \n> >> Signed-off-by: Marcus Griep <marcus@griep.us>\n> >> ---\n> >> \n> >>  This patch v2 cleans up a few code items, corrects a misspelling,\n> >>  and ensures that the temp file gets unlinked when we exit, now\n> >>  that we are requesting the filename.  Otherwise, the previous\n> >>  comments stand:\n> >>  \n> >>  Per the earlier patch versions by Abhijit Menon-Sen and Tom G. Christensen.\n> >>  Both of you may want to run a test and add your 'Tested-by' to the thread\n> >>  if everything works out before Eric Wong adds his 'Acked-by'.\n> >\n> > Thanks Marcus, this works for me.\n> > (Perl 5.10.0, so no compatibility issues).\n> >\n> > <bikeshed>\n> > Can we rename temp_fname() to temp_path(), though?  \"fname\"\n> > just doesn't look right in the API to me...\n> > </bikeshed>\n> \n> Ok, so will you take the patch with bikeshed fixes and feed the result to\n> me with a pull-request, or shall I do that myself?  I do not mind doing\n> this either way --- just trying to avoid duplicated work.\n\nPlease do it for me, thanks.  I've been preoccuppied offline and need\nsleep.\n\n> This is a 'maint' material, right?\n\nYes, definitely.\n\n-- \nEric Wong\n"},{"id":"90354","messageId":"1221059386-3972-1-git-send-email-marcus@griep.us","threadId":"15317","inReplyTo":"48C7745F.1070008@statsbiblioteket.dk","subject":"[PATCH] git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl","fromName":"Marcus Griep","fromEmail":"marcus@griep.us","sentAt":"2008-09-10T15:09:46Z","receivedAt":"2008-09-10T15:09:46Z","isPatch":true,"sender":{"key":"marcus@griep.us","avatar":"https://gravatar.com/avatar/0a841f2aad3f9a38c9bcf87a567c2a1751cb08924bae1bc46ee171395bcf9794?d=mp&s=160"},"body":"---\n\n Per Tom G. Christensen's commentary on a breaking test in git-svn.\n\n git-svn.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ecacf74..a97e1ca 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -4425,7 +4425,7 @@ sub config_pager {\n \n sub run_pager {\n \treturn unless -t *STDOUT && defined $pager;\n-\tpipe my $rfd, my $wfd or return;\n+\tpipe my ($rfd, $wfd) or return;\n \tdefined(my $pid = fork) or ::fatal \"Can't fork: $!\";\n \tif (!$pid) {\n \t\topen STDOUT, '>&', $wfd or\n-- \n1.6.0.1.415.g7bb82\n"},{"id":"90356","messageId":"48C7E393.2070006@griep.us","threadId":"15317","inReplyTo":"1221059386-3972-1-git-send-email-marcus@griep.us","subject":"Re: [PATCH] git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl","fromName":"Marcus Griep","fromEmail":"marcus@griep.us","sentAt":"2008-09-10T15:11:15Z","receivedAt":"2008-09-10T15:11:15Z","isPatch":true,"sender":{"key":"marcus@griep.us","avatar":"https://gravatar.com/avatar/0a841f2aad3f9a38c9bcf87a567c2a1751cb08924bae1bc46ee171395bcf9794?d=mp&s=160"},"body":"Sorry:\n\nSigned-off-by: Marcus Griep <marcus@griep.us>\n\nMarcus Griep wrote:\n> ---\n> \n>  Per Tom G. Christensen's commentary on a breaking test in git-svn.\n> \n>  git-svn.perl |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index ecacf74..a97e1ca 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -4425,7 +4425,7 @@ sub config_pager {\n>  \n>  sub run_pager {\n>  \treturn unless -t *STDOUT && defined $pager;\n> -\tpipe my $rfd, my $wfd or return;\n> +\tpipe my ($rfd, $wfd) or return;\n>  \tdefined(my $pid = fork) or ::fatal \"Can't fork: $!\";\n>  \tif (!$pid) {\n>  \t\topen STDOUT, '>&', $wfd or\n\n-- \nMarcus Griep\nGPG Key ID: 0x5E968152\n——\nhttp://www.boohaunt.net\nאת.ψο´\n"}]}