git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-gui: properly popup error if gitk should be started but is not installed

From
Gerrit Pape <pape@smarden.org>
Date
Jun 29, 2007, 11:32 UTC
Message-ID
<20070629113229.23815.qmail@e211c3361797a3.315fe32.mid.smarden.org>

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>
---
 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
Message 1 of 1 in “git-gui: properly popup error if gitk should be started but is not installed”
  1. git-gui: properly popup error if gitk should be started but is not installedGerrit Pape, Jun 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.