[PATCH] git-gui: properly popup error if gitk should be started but is not installed
From: Gerrit Pape <hidden>
Date: 2016-06-15 22:43:18
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Gerrit Pape <hidden>
Date: 2016-06-15 22:43:18
Subsystem:
the rest · Maintainer:
Linus Torvalds
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 <redacted> --- git-gui.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 9df2e47..1b0691c 100755
--- a/git-gui.sh
+++ b/git-gui.sh@@ -1070,10 +1070,10 @@ proc do_gitk {revs} { append cmd { } append cmd $revs } - - if {[catch {eval exec $cmd &} err]} { - error_popup "Failed to start gitk:\n\n$err" + if {! [file exists [gitexec gitk]]} { + error_popup "Unable to start gitk:\n\nFile does not exist" } else { + eval exec $cmd & set ui_status_value $starting_gitk_msg after 10000 { if {$ui_status_value eq $starting_gitk_msg} {
--
1.5.2.1