* [PATCH] Use "gitk: /path/to/repo" as gitk window title.
@ 2009-08-13 19:58 Zbyszek Szmek
0 siblings, 0 replies; only message in thread
From: Zbyszek Szmek @ 2009-08-13 19:58 UTC (permalink / raw)
To: git; +Cc: zbyszek
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-13 20:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-13 19:58 [PATCH] Use "gitk: /path/to/repo" as gitk window title Zbyszek Szmek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox