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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Markus Heidelberg <markus.heidelberg@xxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]