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

[PATCH] git-svn: Allow using arguments to the editor.

From
GFGerfried Fuchs <rhonda@deb.at>
Date
Feb 18, 2009, 13:47 UTC
Message-ID
<1234964869-11159-1-git-send-email-rhonda@deb.at>

When setting the EDITOR or VISUAL environment variable, one might want to hand over arguments (like e.g. for not backgrounding a GUI editor but waiting for it to finish. This patch enables that posibility, before it did look for a program with the content of the variable, including the space as filename part. The change is in sync with regular behavior with various other tools, git itself included.

Signed-off-by: Gerfried Fuchs <rhonda@deb.at>
---
 git-svn.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 83cb36f..d29664c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1137,8 +1137,9 @@ sub get_commit_entry {
 
 	if ($_edit || ($type eq 'tree')) {
 		my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi';
+		my (@editor) = split /\s+/, $editor;
 		# TODO: strip out spaces, comments, like git-commit.sh
-		system($editor, $commit_editmsg);
+		system(@editor, $commit_editmsg);
 	}
 	rename $commit_editmsg, $commit_msg or croak $!;
 	{
-- 
1.5.6.5
Next: Thomas Rast
Message 1 of 5 in “git-svn: Allow using arguments to the editor.”
  1. git-svn: Allow using arguments to the editor.Gerfried Fuchs, Feb 18, 2009
  2. Thomas RastFeb 18, 2009
  3. Gerfried FuchsFeb 18, 2009
  4. Thomas RastFeb 18, 2009
  5. Eric WongFeb 19, 2009

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.