aboutsummaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2007-06-29 11:32:29 +0000
committerShawn O. Pearce <spearce@spearce.org>2007-06-30 00:43:20 -0400
commit7aecb128779ffd8258f01f4382df963900ae6acd (patch)
tree60064ad74fd30dc8dc9e000c34665ca5b33a6944 /git-gui.sh
parent7e508eb1a2efce72be1651a35ab3150bfa3c88d6 (diff)
downloadgit-7aecb128779ffd8258f01f4382df963900ae6acd.tar.gz
git-7aecb128779ffd8258f01f4382df963900ae6acd.tar.xz
git-gui: properly popup error if gitk should be started but is not installed
On 'Visualize ...', a gitk process is started. Since it is run in the background, catching a possible startup error doesn't work, and the error output goes to the console git-gui is started from. The most probable startup error is that gitk is not installed; so before trying to start, check for the existence of the gitk program, and popup an error message unless it's found. This was noticed and reported by Paul Wise through http://bugs.debian.org/429810 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 4fbc408c4..6b7321bb0 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1042,15 +1042,17 @@ proc do_gitk {revs} {
# lets us bypass using shell process on Windows systems.
#
set cmd [list [info nameofexecutable]]
- lappend cmd [gitexec gitk]
+ set exe [gitexec gitk]
+ lappend cmd $exe
if {$revs ne {}} {
append cmd { }
append cmd $revs
}
- if {[catch {eval exec $cmd &} err]} {
- error_popup "Failed to start gitk:\n\n$err"
+ if {! [file exists $exe]} {
+ error_popup "Unable to start gitk:\n\n$exe does not exist"
} else {
+ eval exec $cmd &
set ui_status_value $starting_gitk_msg
after 10000 {
if {$ui_status_value eq $starting_gitk_msg} {