{"thread":{"id":"37836","subject":"[PATCH] Git.pm: add specified name to tempfile template","startedAt":"2014-10-29T19:31:55Z","lastAt":"2014-10-29T19:50:49Z","messageCount":2,"participants":["Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"251189","messageId":"20141029193155.GA2232@dcvr.yhbt.net","threadId":"37836","inReplyTo":null,"subject":"[PATCH] Git.pm: add specified name to tempfile template","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2014-10-29T19:31:55Z","receivedAt":"2014-10-29T19:31:55Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This should help me track down errors in git-svn more easily:\n\n\twrite .git/Git_XXXXXX: Bad file descriptor\n\t at /usr/lib/perl5/SVN/Ra.pm line 623\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n  Not sure you want to take this separately or in a git-svn pull.\n  Still working on the error this patch is meant to help me find.\n\n perl/Git.pm | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 204fdc6..b5905ee 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -1294,8 +1294,11 @@ sub _temp_cache {\n \t\t\t$tmpdir = $self->repo_path();\n \t\t}\n \n+\t\tmy $n = $name;\n+\t\t$n =~ s/\\W/_/g; # no strange chars\n+\n \t\t($$temp_fd, $fname) = File::Temp::tempfile(\n-\t\t\t'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,\n+\t\t\t\"Git_${n}_XXXXXX\", UNLINK => 1, DIR => $tmpdir,\n \t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n \n \t\t$$temp_fd->autoflush;\n-- \nEW\n"},{"id":"251192","messageId":"xmqqd29ay7s6.fsf@gitster.dls.corp.google.com","threadId":"37836","inReplyTo":"20141029193155.GA2232@dcvr.yhbt.net","subject":"Re: [PATCH] Git.pm: add specified name to tempfile template","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-10-29T19:50:49Z","receivedAt":"2014-10-29T19:50:49Z","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> This should help me track down errors in git-svn more easily:\n>\n> \twrite .git/Git_XXXXXX: Bad file descriptor\n> \t at /usr/lib/perl5/SVN/Ra.pm line 623\n>\n> Signed-off-by: Eric Wong <normalperson@yhbt.net>\n> ---\n>   Not sure you want to take this separately or in a git-svn pull.\n>   Still working on the error this patch is meant to help me find.\n\nThanks; I think it is OK for it to be part of the git-svn update.\nNo other active perl/Git.pm user that wants to have access to this\nfacility early exists as far as I can see ;-)\n\n>\n>  perl/Git.pm | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/perl/Git.pm b/perl/Git.pm\n> index 204fdc6..b5905ee 100644\n> --- a/perl/Git.pm\n> +++ b/perl/Git.pm\n> @@ -1294,8 +1294,11 @@ sub _temp_cache {\n>  \t\t\t$tmpdir = $self->repo_path();\n>  \t\t}\n>  \n> +\t\tmy $n = $name;\n> +\t\t$n =~ s/\\W/_/g; # no strange chars\n> +\n>  \t\t($$temp_fd, $fname) = File::Temp::tempfile(\n> -\t\t\t'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,\n> +\t\t\t\"Git_${n}_XXXXXX\", UNLINK => 1, DIR => $tmpdir,\n>  \t\t\t) or throw Error::Simple(\"couldn't open new temp file\");\n>  \n>  \t\t$$temp_fd->autoflush;\n"}]}