DORMANTno replies

[PATCH] Use "gitk: /path/to/repo" as gitk window title.

From: Zbyszek Szmek <hidden>
Date: 2016-06-15 22:47:14
Subsystem: the rest · Maintainer: Linus Torvalds

In case of non-bare repos, the .git suffix in the path is skipped.

Previously, when run in a subdirectory, gitk would show the name
of this subdirectory as the title, which was misleading.
---
 gitk-git/gitk |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 4604c83..e656e81 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -16,6 +16,14 @@ proc gitdir {} {
     }
 }
 
+proc reponame {} {
+    set n [file normalize [gitdir]]
+    if {[string match "*/.git" $n]} {
+	set n [string range $n 0 end-5]
+    }
+    return $n
+}
+
 # A simple scheduler for compute-intensive stuff.
 # The aim is to make sure that event handlers for GUI actions can
 # run at least every 50-100 ms.  Unfortunately fileevent handlers are
@@ -11156,6 +11164,8 @@ set nullfile "/dev/null"
 set have_tk85 [expr {[package vcompare $tk_version "8.5"] >= 0}]
 set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
 
+set appname "gitk"
+
 set runq {}
 set history {}
 set historyindex 0
@@ -11220,7 +11230,7 @@ catch {
 }
 # wait for the window to become visible
 tkwait visibility .
-wm title . "[file tail $argv0]: [file tail [pwd]]"
+wm title . "$appname: [reponame]"
 update
 readrefs
 
-- 
1.6.3.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help