{"thread":{"id":"16284","subject":"[PATCH] git-svn: Update git-svn to use the ability to place temporary files within repository directory","startedAt":"2008-11-12T14:33:25Z","lastAt":"2008-11-13T09:41:47Z","messageCount":3,"participants":["Marten Svanfeldt (dev)","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"95566","messageId":"491AE935.4040406@svanfeldt.com","threadId":"16284","inReplyTo":null,"subject":"[PATCH] git-svn: Update git-svn to use the ability to place temporary files within repository directory","fromName":"Marten Svanfeldt (dev)","fromEmail":"developer@svanfeldt.com","sentAt":"2008-11-12T14:33:25Z","receivedAt":"2008-11-12T14:33:25Z","isPatch":true,"sender":{"key":"developer@svanfeldt.com","avatar":null},"body":"This fixes git-svn within msys where Perl will provide temporary files\nwith path such as /tmp while the git suit expects native Windows paths.\n\nSigned-off-by: Marten Svanfeldt <developer@svanfeldt.com>\n---\n git-svn.perl |    9 +++++----\n 1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ef6d773..f09f981 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3312,11 +3312,11 @@ sub change_file_prop {\n\n sub apply_textdelta {\n \tmy ($self, $fb, $exp) = @_;\n-\tmy $fh = Git::temp_acquire('svn_delta');\n+\tmy $fh = $_repository->temp_acquire('svn_delta');\n \t# $fh gets auto-closed() by SVN::TxDelta::apply(),\n \t# (but $base does not,) so dup() it for reading in close_file\n \topen my $dup, '<&', $fh or croak $!;\n-\tmy $base = Git::temp_acquire('git_blob');\n+\tmy $base = $_repository->temp_acquire('git_blob');\n \tif ($fb->{blob}) {\n \t\tprint $base 'link ' if ($fb->{mode_a} == 120000);\n \t\tmy $size = $::_repository->cat_blob($fb->{blob}, $base);\n@@ -3357,7 +3357,8 @@ sub close_file {\n \t\t\t\twarn \"$path has mode 120000\",\n \t\t\t\t\t\t\" but is not a link\\n\";\n \t\t\t} else {\n-\t\t\t\tmy $tmp_fh = Git::temp_acquire('svn_hash');\n+\t\t\t\tmy $tmp_fh = $_repository->temp_acquire(\n+\t\t\t\t\t'svn_hash');\n \t\t\t\tmy $res;\n \t\t\t\twhile ($res = sysread($fh, my $str, 1024)) {\n \t\t\t\t\tmy $out = syswrite($tmp_fh, $str, $res);\n@@ -3745,7 +3746,7 @@ sub change_file_prop {\n\n sub _chg_file_get_blob ($$$$) {\n \tmy ($self, $fbat, $m, $which) = @_;\n-\tmy $fh = Git::temp_acquire(\"git_blob_$which\");\n+\tmy $fh = $_repository->temp_acquire(\"git_blob_$which\");\n \tif ($m->{\"mode_$which\"} =~ /^120/) {\n \t\tprint $fh 'link ' or croak $!;\n \t\t$self->change_file_prop($fbat,'svn:special','*');\n-- \n1.6.0.3.1437.g6c121.dirty\n"},{"id":"95577","messageId":"491B066E.8030501@svanfeldt.com","threadId":"16284","inReplyTo":"491AE935.4040406@svanfeldt.com","subject":"[PATCH fixed] git-svn: Update git-svn to use the ability to place temporary files within repository directory","fromName":"Marten Svanfeldt (dev)","fromEmail":"developer@svanfeldt.com","sentAt":"2008-11-12T16:38:06Z","receivedAt":"2008-11-12T16:38:06Z","isPatch":true,"sender":{"key":"developer@svanfeldt.com","avatar":null},"body":"\nThis fixes git-svn within msys where Perl will provide temporary files with path\nsuch as /tmp while the git suit expects native Windows paths.\n\nSigned-off-by: Marten Svanfeldt <developer@svanfeldt.com>\n---\nSomehow I managed to screw up the last patch when getting it ready for\nsubmission. This patch is a fixed version that actually works.\n\n git-svn.perl |    9 +++++----\n 1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex ef6d773..23ceaff 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3312,11 +3312,11 @@ sub change_file_prop {\n\n sub apply_textdelta {\n \tmy ($self, $fb, $exp) = @_;\n-\tmy $fh = Git::temp_acquire('svn_delta');\n+\tmy $fh = $::_repository->temp_acquire('svn_delta');\n \t# $fh gets auto-closed() by SVN::TxDelta::apply(),\n \t# (but $base does not,) so dup() it for reading in close_file\n \topen my $dup, '<&', $fh or croak $!;\n-\tmy $base = Git::temp_acquire('git_blob');\n+\tmy $base = $::_repository->temp_acquire('git_blob');\n \tif ($fb->{blob}) {\n \t\tprint $base 'link ' if ($fb->{mode_a} == 120000);\n \t\tmy $size = $::_repository->cat_blob($fb->{blob}, $base);\n@@ -3357,7 +3357,8 @@ sub close_file {\n \t\t\t\twarn \"$path has mode 120000\",\n \t\t\t\t\t\t\" but is not a link\\n\";\n \t\t\t} else {\n-\t\t\t\tmy $tmp_fh = Git::temp_acquire('svn_hash');\n+\t\t\t\tmy $tmp_fh = $::_repository->temp_acquire(\n+\t\t\t\t\t'svn_hash');\n \t\t\t\tmy $res;\n \t\t\t\twhile ($res = sysread($fh, my $str, 1024)) {\n \t\t\t\t\tmy $out = syswrite($tmp_fh, $str, $res);\n@@ -3745,7 +3746,7 @@ sub change_file_prop {\n\n sub _chg_file_get_blob ($$$$) {\n \tmy ($self, $fbat, $m, $which) = @_;\n-\tmy $fh = Git::temp_acquire(\"git_blob_$which\");\n+\tmy $fh = $::_repository->temp_acquire(\"git_blob_$which\");\n \tif ($m->{\"mode_$which\"} =~ /^120/) {\n \t\tprint $fh 'link ' or croak $!;\n \t\t$self->change_file_prop($fbat,'svn:special','*');\n-- \n1.6.0.3.1439.gc9385a\n"},{"id":"95673","messageId":"20081113094147.GA26898@untitled","threadId":"16284","inReplyTo":"491AE935.4040406@svanfeldt.com","subject":"Re: [PATCH] git-svn: Update git-svn to use the ability to place temporary files within repository directory","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-11-13T09:41:47Z","receivedAt":"2008-11-13T09:41:47Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"\"Marten Svanfeldt (dev)\" <developer@svanfeldt.com> wrote:\n> This fixes git-svn within msys where Perl will provide temporary files\n> with path such as /tmp while the git suit expects native Windows paths.\n\nAh, I completely didn't understand the related Git.pm patch from you\nuntil I saw this sentence above.\n\nCan you update that other patch and clarify this statement so it\nmakes sense to UNIX-only folks?\n\n | This fixes issues when the Perl in use uses a different format for paths\n | than in use by native code in the git tools such as msysgit with msys-perl.\n\nThanks,\n\n-- \nEric Wong\n"}]}