Package: git-core
Version: 1:1.5.6.3-1
Severity: minor

Here's a patch to (I hope) catch all the remaining situations in which
git falls back to "vi" rather than "editor".  I don't have access to a
Debian system on which I have permission to install packages any more,
so I have not been able to test the .debs it produces.  But I think it
should be okay.  I hope it is of some use.

Thanks,
Jonathan

-- snipsnip --
This patch takes care of those instances of hardcoded "vi" that 
remain after the fix to bug #438793

Signed-off-by: Jonathan Nieder <[EMAIL PROTECTED]>
---
 contrib/fast-import/git-p4 |    2 +-
 git-add--interactive.perl  |    2 +-
 git-send-email.perl        |    3 ++-
 git-sh-setup.sh            |    2 +-
 git-svn.perl               |    2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 6ae0429..3d2a491 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -651,7 +651,7 @@ class P4Submit(Command):
                 newdiff = newdiff.replace("\n", "\r\n")
             tmpFile.write(submitTemplate + separatorLine + diff + newdiff)
             tmpFile.close()
-            defaultEditor = "vi"
+            defaultEditor = "editor"
             if platform.system() == "Windows":
                 defaultEditor = "notepad"
             if os.environ.has_key("P4EDITOR"):
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index da768ee..020c7a3 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -728,7 +728,7 @@ EOF
        close $fh;
 
        my $editor = $ENV{GIT_EDITOR} || $repo->config("core.editor")
-               || $ENV{VISUAL} || $ENV{EDITOR} || "vi";
+               || $ENV{VISUAL} || $ENV{EDITOR} || "editor";
        system('sh', '-c', $editor.' "$@"', $editor, $hunkfile);
 
        open $fh, '<', $hunkfile
diff --git a/git-send-email.perl b/git-send-email.perl
index d2fd899..dc0e335 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -530,7 +530,8 @@ GIT: for the patch you are writing.
 EOT
        close(C);
 
-       my $editor = $ENV{GIT_EDITOR} || Git::config(@repo, "core.editor") || 
$ENV{VISUAL} || $ENV{EDITOR} || "vi";
+       my $editor = $ENV{GIT_EDITOR} || Git::config(@repo,
+                "core.editor") || $ENV{VISUAL} || $ENV{EDITOR} || "editor";
        system('sh', '-c', $editor.' "$@"', $editor, $compose_filename);
 
        open(C2,">",$compose_filename . ".final")
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index d17b349..059e461 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -67,7 +67,7 @@ git_editor() {
        case "$GIT_EDITOR,$TERM" in
        ,dumb)
                echo >&2 "No editor specified in GIT_EDITOR, core.editor, 
VISUAL,"
-               echo >&2 "or EDITOR. Tried to fall back to vi but terminal is 
dumb."
+               echo >&2 "or EDITOR. Tried to fall back to editor but terminal 
is dumb."
                echo >&2 "Please set one of these variables to an appropriate"
                echo >&2 "editor or run $0 with options that will not cause an"
                echo >&2 "editor to be invoked (e.g., -m or -F for git-commit)."
diff --git a/git-svn.perl b/git-svn.perl
index 0dbdec6..35419d9 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1052,7 +1052,7 @@ sub get_commit_entry {
        close $log_fh or croak $!;
 
        if ($_edit || ($type eq 'tree')) {
-               my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi';
+               my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'editor';
                # TODO: strip out spaces, comments, like git-commit.sh
                system($editor, $commit_editmsg);
        }
-- 
1.6.0.rc1.228.ge730





-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to