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

[PATCH 1/2] git-gui: move gitk launcher into a separate file

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
May 2, 2009, 09:20 UTC
Message-ID
<1241256054-14117-1-git-send-email-markus.heidelberg@web.de>
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 git-gui.sh   |   39 ---------------------------------------
 lib/gitk.tcl |   41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 39 deletions(-)
 create mode 100644 lib/gitk.tcl
diff --git a/git-gui.sh b/git-gui.sh
index 14b92ba..6ff04c4 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1902,45 +1902,6 @@ proc incr_font_size {font {amt 1}} {
 ##
 ## ui commands
 
-set starting_gitk_msg [mc "Starting gitk... please wait..."]
-
-proc do_gitk {revs} {
-	# -- Always start gitk through whatever we were loaded with.  This
-	#    lets us bypass using shell process on Windows systems.
-	#
-	set exe [_which gitk -script]
-	set cmd [list [info nameofexecutable] $exe]
-	if {$exe eq {}} {
-		error_popup [mc "Couldn't find gitk in PATH"]
-	} else {
-		global env
-
-		if {[info exists env(GIT_DIR)]} {
-			set old_GIT_DIR $env(GIT_DIR)
-		} else {
-			set old_GIT_DIR {}
-		}
-
-		set pwd [pwd]
-		cd [file dirname [gitdir]]
-		set env(GIT_DIR) [file tail [gitdir]]
-
-		eval exec $cmd $revs &
-
-		if {$old_GIT_DIR eq {}} {
-			unset env(GIT_DIR)
-		} else {
-			set env(GIT_DIR) $old_GIT_DIR
-		}
-		cd $pwd
-
-		ui_status $::starting_gitk_msg
-		after 10000 {
-			ui_ready $starting_gitk_msg
-		}
-	}
-}
-
 proc do_explore {} {
 	set explorer {}
 	if {[is_Cygwin] || [is_Windows]} {
diff --git a/lib/gitk.tcl b/lib/gitk.tcl
new file mode 100644
index 0000000..fcbb73d
--- /dev/null
+++ b/lib/gitk.tcl
@@ -0,0 +1,41 @@
+# git-gui gitk launcher
+# Copyright (C) 2006, 2007 Shawn Pearce
+
+set starting_gitk_msg [mc "Starting gitk... please wait..."]
+
+proc do_gitk {revs} {
+	# -- Always start gitk through whatever we were loaded with.  This
+	#    lets us bypass using shell process on Windows systems.
+	#
+	set exe [_which gitk -script]
+	set cmd [list [info nameofexecutable] $exe]
+	if {$exe eq {}} {
+		error_popup [mc "Couldn't find gitk in PATH"]
+	} else {
+		global env
+
+		if {[info exists env(GIT_DIR)]} {
+			set old_GIT_DIR $env(GIT_DIR)
+		} else {
+			set old_GIT_DIR {}
+		}
+
+		set pwd [pwd]
+		cd [file dirname [gitdir]]
+		set env(GIT_DIR) [file tail [gitdir]]
+
+		eval exec $cmd $revs &
+
+		if {$old_GIT_DIR eq {}} {
+			unset env(GIT_DIR)
+		} else {
+			set env(GIT_DIR) $old_GIT_DIR
+		}
+		cd $pwd
+
+		ui_status $::starting_gitk_msg
+		after 10000 {
+			ui_ready $starting_gitk_msg
+		}
+	}
+}
-- 
1.6.3.rc3.79.g777c
Next: Markus Heidelberg
Message 1 of 2 in “git-gui: move gitk launcher into a separate file”
  1. 1/2 git-gui: move gitk launcher into a separate fileMarkus Heidelberg, May 2, 2009
  2. 2/2 git-gui: add menu item to select a branch to visualize with gitkMarkus Heidelberg, May 2, 2009

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.