{"thread":{"id":"4609","subject":"[PATCH] git-svn: fix commit --edit flag when using SVN:: libraries","startedAt":"2006-06-22T08:22:46Z","lastAt":"2006-06-22T08:22:46Z","messageCount":1,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22246","messageId":"11509645661829-git-send-email-normalperson@yhbt.net","threadId":"4609","inReplyTo":null,"subject":"[PATCH] git-svn: fix commit --edit flag when using SVN:: libraries","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-06-22T08:22:46Z","receivedAt":"2006-06-22T08:22:46Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Trying to open an interactive editor in the console while stdout is\nbeing piped to the parent process doesn't work out very well.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n contrib/git-svn/git-svn.perl |   14 ++++++++------\n 1 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl\nindex 7e7f2f0..08c3010 100755\n--- a/contrib/git-svn/git-svn.perl\n+++ b/contrib/git-svn/git-svn.perl\n@@ -479,17 +479,18 @@ sub commit_lib {\n \tmy @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();\n \tmy $commit_msg = \"$GIT_SVN_DIR/.svn-commit.tmp.$$\";\n \n+\tif (defined $LC_ALL) {\n+\t\t$ENV{LC_ALL} = $LC_ALL;\n+\t} else {\n+\t\tdelete $ENV{LC_ALL};\n+\t}\n \tforeach my $c (@revs) {\n+\t\tmy $log_msg = get_commit_message($c, $commit_msg);\n+\n \t\t# fork for each commit because there's a memory leak I\n \t\t# can't track down... (it's probably in the SVN code)\n \t\tdefined(my $pid = open my $fh, '-|') or croak $!;\n \t\tif (!$pid) {\n-\t\t\tif (defined $LC_ALL) {\n-\t\t\t\t$ENV{LC_ALL} = $LC_ALL;\n-\t\t\t} else {\n-\t\t\t\tdelete $ENV{LC_ALL};\n-\t\t\t}\n-\t\t\tmy $log_msg = get_commit_message($c, $commit_msg);\n \t\t\tmy $ed = SVN::Git::Editor->new(\n \t\t\t\t\t{\tr => $r_last,\n \t\t\t\t\t\tra => $SVN,\n@@ -535,6 +536,7 @@ sub commit_lib {\n \t\t\t($r_last, $cmt_last) = ($r_new, $cmt_new);\n \t\t}\n \t}\n+\t$ENV{LC_ALL} = 'C';\n \tunlink $commit_msg;\n }\n \n-- \n1.4.0.g937a\n"}]}