{"thread":{"id":"8773","subject":"[PATCH] git-gui: properly popup error if gitk should be started but is not installed","startedAt":"2007-06-29T11:32:29Z","lastAt":"2007-06-29T11:32:29Z","messageCount":1,"participants":["Gerrit Pape"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46044","messageId":"20070629113229.23815.qmail@e211c3361797a3.315fe32.mid.smarden.org","threadId":"8773","inReplyTo":null,"subject":"[PATCH] git-gui: properly popup error if gitk should be started but is not installed","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-06-29T11:32:29Z","receivedAt":"2007-06-29T11:32:29Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"On 'Visualize ...', a gitk process is started.  Since it is run in the\nbackground, catching a possible startup error doesn't work, and the error\noutput goes to the console git-gui is started from.  The most probable\nstartup error is that gitk is not installed; so before trying to start,\ncheck for the existence of the gitk program, and popup an error message\nunless it's found.\n\nThis was noticed and reported by Paul Wise through\n http://bugs.debian.org/429810\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n git-gui.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 9df2e47..1b0691c 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -1070,10 +1070,10 @@ proc do_gitk {revs} {\n \t\tappend cmd { }\n \t\tappend cmd $revs\n \t}\n-\n-\tif {[catch {eval exec $cmd &} err]} {\n-\t\terror_popup \"Failed to start gitk:\\n\\n$err\"\n+\tif {! [file exists [gitexec gitk]]} {\n+\t\terror_popup \"Unable to start gitk:\\n\\nFile does not exist\"\n \t} else {\n+\t\teval exec $cmd &\n \t\tset ui_status_value $starting_gitk_msg\n \t\tafter 10000 {\n \t\t\tif {$ui_status_value eq $starting_gitk_msg} {\n-- \n1.5.2.1\n"}]}