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

Re: Git.pm with recent File::Temp fail

From
H.Merijn Brand <h.m.brand@xs4all.nl>
Date
Apr 28, 2013, 09:09 UTC
Message-ID
<20130428110933.436786bd@pc09.procura.nl>
In-Reply-To
<CAP30j14=_U8iEZAodnfACnBHgF0+j0_OK7n7PvsUnwSDj_Y40A@mail.gmail.com>

On Sat, 23 Mar 2013 16:32:47 +0000, Ben Walton <bdwalton@gmail.com> wrote:

> Hello,
Still failing in 1.8.2.2

Short fix: --8<---

diff --git a/perl/Git.pm b/perl/Git.pm
index dc48159..7a252ef 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -1265,7 +1265,7 @@ sub _temp_cache {
                        $tmpdir = $self->repo_path();
                }

-               ($$temp_fd, $fname) = File::Temp->tempfile(
+               ($$temp_fd, $fname) = File::Temp::tempfile(
                        'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,
                        ) or throw Error::Simple("couldn't open new temp file");

-->8---

Long fix inlined

> On Fri, Mar 22, 2013 at 7:57 PM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote:
> > git-1.8.2, perl-5.16.3, File::Temp-0.23
> >
> > Without patch:
> >
> > $ git svn fetch
> > 'tempfile' can't be called as a method at /pro/lib/perl5/site_perl/5.16.3/Git.pm line 1117.
> >
> > After patch:
> >
> > $ git svn fetch
> >         M       t/06virtual.t
> > r15506 = 6c65be7ff36ffc6fd9b960a4b470ca297103004e (refs/remotes/git-svn)
> > ⋮
> >
> > patch attached
> 
> This list prefers patches to be inline so that they can easily be
> commented on, etc.  I took a quick look at your patch and while it
> looks fine to me, fwiw.
> 
> You may want to resubmit using git send-email though so that others
> will look at it and possibly apply it.

From b3be713101469f8bea14b854eb7840132ffdca8a Mon Sep 17 00:00:00 2001
From: "H.Merijn Brand - Tux" <h.m.brand@xs4all.nl>
Date: Sun, 28 Apr 2013 11:03:15 +0200
Subject: [PATCH] Git.pm with recent File::Temp fail
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.8.2.1"

This is a multi-part message in MIME format.
--------------1.8.2.1
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


git-1.8.2{,.1,.2}, perl-5.16.3, File::Temp-0.23

Without patch:

$ git svn fetch
'tempfile' can't be called as a method at /pro/lib/perl5/site_perl/5.16.3/Git.pm line 1117.

After patch:

$ git svn fetch
        M       t/06virtual.t
r15506 = 6c65be7ff36ffc6fd9b960a4b470ca297103004e (refs/remotes/git-svn)
---
 perl/Git.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--------------1.8.2.1
Content-Type: text/x-patch; name="0001-Git.pm-with-recent-File-Temp-fail.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Git.pm-with-recent-File-Temp-fail.patch"

diff --git a/perl/Git.pm b/perl/Git.pm
index dc48159..7a252ef 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -1265,7 +1265,7 @@ sub _temp_cache {
                        $tmpdir = $self->repo_path();
                }

-               ($$temp_fd, $fname) = File::Temp->tempfile(
+               ($$temp_fd, $fname) = File::Temp::tempfile(
                        'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,
                        ) or throw Error::Simple("couldn't open new temp file");


--------------1.8.2.1--
-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.17   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/
Previous: H.Merijn BrandNext: Jeff King
Message 3 of 9 in “Git.pm with recent File::Temp fail”
  1. H.Merijn BrandMar 22, 2013
  2. H.Merijn BrandApr 8, 2013
  3. H.Merijn BrandApr 28, 2013
  4. Jeff KingApr 29, 2013
  5. Junio C HamanoApr 29, 2013
  6. H.Merijn BrandApr 29, 2013
  7. Junio C HamanoApr 29, 2013
  8. Junio C HamanoApr 29, 2013
  9. H.Merijn BrandApr 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.