summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorLibravatar Alexander Gavrilov <angavrilov@gmail.com>2008-10-15 13:28:21 +0400
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2008-11-01 16:01:34 -0700
commit8c76212529570aed70c46d6f252cb1a4010f3f2e (patch)
treee5be1df71c65fefd05640bc99c22f2b6768900ae /git-gui.sh
parentgit-gui: Add a dialog that shows the OpenSSH public key. (diff)
downloadtgif-8c76212529570aed70c46d6f252cb1a4010f3f2e.tar.xz
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 <angavrilov@gmail.com> Acked-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh12
1 files changed, 12 insertions, 0 deletions
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 . <Visibility> {
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
+ }
}
######################################################################
@@ -1071,6 +1076,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