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

[PATCH] Git.pm: add specified name to tempfile template

From
EWEric Wong <normalperson@yhbt.net>
Date
Oct 29, 2014, 19:31 UTC
Message-ID
<20141029193155.GA2232@dcvr.yhbt.net>
This should help me track down errors in git-svn more easily:
	write .git/Git_XXXXXX: Bad file descriptor
	 at /usr/lib/perl5/SVN/Ra.pm line 623
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
  Not sure you want to take this separately or in a git-svn pull.
  Still working on the error this patch is meant to help me find.
 perl/Git.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/perl/Git.pm b/perl/Git.pm
index 204fdc6..b5905ee 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -1294,8 +1294,11 @@ sub _temp_cache {
 			$tmpdir = $self->repo_path();
 		}
 
+		my $n = $name;
+		$n =~ s/\W/_/g; # no strange chars
+
 		($$temp_fd, $fname) = File::Temp::tempfile(
-			'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,
+			"Git_${n}_XXXXXX", UNLINK => 1, DIR => $tmpdir,
 			) or throw Error::Simple("couldn't open new temp file");
 
 		$$temp_fd->autoflush;
-- 
EW
Next: Junio C Hamano
Message 1 of 2 in “Git.pm: add specified name to tempfile template”
  1. Git.pm: add specified name to tempfile templateEric Wong, Oct 29, 2014
  2. Junio C HamanoOct 29, 2014

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.