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

[PATCH] git-svn: fix commit --edit flag when using SVN:: libraries

From
EWEric Wong <normalperson@yhbt.net>
Date
Jun 22, 2006, 08:22 UTC
Message-ID
<11509645661829-git-send-email-normalperson@yhbt.net>

Trying to open an interactive editor in the console while stdout is being piped to the parent process doesn't work out very well.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 contrib/git-svn/git-svn.perl |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/contrib/git-svn/git-svn.perl b/contrib/git-svn/git-svn.perl
index 7e7f2f0..08c3010 100755
--- a/contrib/git-svn/git-svn.perl
+++ b/contrib/git-svn/git-svn.perl
@@ -479,17 +479,18 @@ sub commit_lib {
 	my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();
 	my $commit_msg = "$GIT_SVN_DIR/.svn-commit.tmp.$$";
 
+	if (defined $LC_ALL) {
+		$ENV{LC_ALL} = $LC_ALL;
+	} else {
+		delete $ENV{LC_ALL};
+	}
 	foreach my $c (@revs) {
+		my $log_msg = get_commit_message($c, $commit_msg);
+
 		# fork for each commit because there's a memory leak I
 		# can't track down... (it's probably in the SVN code)
 		defined(my $pid = open my $fh, '-|') or croak $!;
 		if (!$pid) {
-			if (defined $LC_ALL) {
-				$ENV{LC_ALL} = $LC_ALL;
-			} else {
-				delete $ENV{LC_ALL};
-			}
-			my $log_msg = get_commit_message($c, $commit_msg);
 			my $ed = SVN::Git::Editor->new(
 					{	r => $r_last,
 						ra => $SVN,
@@ -535,6 +536,7 @@ sub commit_lib {
 			($r_last, $cmt_last) = ($r_new, $cmt_new);
 		}
 	}
+	$ENV{LC_ALL} = 'C';
 	unlink $commit_msg;
 }
 
-- 
1.4.0.g937a
Message 1 of 1 in “git-svn: fix commit --edit flag when using SVN:: libraries”
  1. git-svn: fix commit --edit flag when using SVN:: librariesEric Wong, Jun 22, 2006

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.