From 8c76212529570aed70c46d6f252cb1a4010f3f2e Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Wed, 15 Oct 2008 13:28:21 +0400 Subject: git-gui: Add a simple implementation of SSH_ASKPASS. OpenSSH allows specifying an external program to use for direct user interaction. While most Linux systems already have such programs, some environments, for instance, msysgit, lack it. This patch adds a simple fallback Tcl implementation of the tool. In msysgit it is also necessary to set a fake value of the DISPLAY variable, because otherwise ssh won't even try to use SSH_ASKPASS handlers. Signed-off-by: Alexander Gavrilov Acked-by: Johannes Sixt Signed-off-by: Shawn O. Pearce --- git-gui.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'git-gui.sh') diff --git a/git-gui.sh b/git-gui.sh index e4d1f70f1c..12b496bec9 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -592,6 +592,11 @@ bind . { if {[is_Windows]} { wm iconbitmap . -default $oguilib/git-gui.ico set ::tk::AlwaysShowSelection 1 + + # Spoof an X11 display for SSH + if {![info exists env(DISPLAY)]} { + set env(DISPLAY) :9999 + } } ###################################################################### @@ -1070,6 +1075,13 @@ set nullid2 "0000000000000000000000000000000000000001" set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}] +###################################################################### + +# Suggest our implementation of askpass, if none is set +if {![info exists env(SSH_ASKPASS)]} { + set env(SSH_ASKPASS) [gitexec git-gui--askpass] +} + ###################################################################### ## ## task management -- cgit 1.2.3-korg