{"thread":{"id":"20587","subject":"[PATCH] Use \"gitk: /path/to/repo\" as gitk window title.","startedAt":"2009-08-13T19:58:30Z","lastAt":"2009-08-13T19:58:30Z","messageCount":1,"participants":["Zbyszek Szmek"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"120572","messageId":"20090813195830.GL24561@in.waw.pl","threadId":"20587","inReplyTo":null,"subject":"[PATCH] Use \"gitk: /path/to/repo\" as gitk window title.","fromName":"Zbyszek Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2009-08-13T19:58:30Z","receivedAt":"2009-08-13T19:58:30Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"In case of non-bare repos, the .git suffix in the path is skipped.\n\nPreviously, when run in a subdirectory, gitk would show the name\nof this subdirectory as the title, which was misleading.\n---\n gitk-git/gitk |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 4604c83..e656e81 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -16,6 +16,14 @@ proc gitdir {} {\n     }\n }\n \n+proc reponame {} {\n+    set n [file normalize [gitdir]]\n+    if {[string match \"*/.git\" $n]} {\n+\tset n [string range $n 0 end-5]\n+    }\n+    return $n\n+}\n+\n # A simple scheduler for compute-intensive stuff.\n # The aim is to make sure that event handlers for GUI actions can\n # run at least every 50-100 ms.  Unfortunately fileevent handlers are\n@@ -11156,6 +11164,8 @@ set nullfile \"/dev/null\"\n set have_tk85 [expr {[package vcompare $tk_version \"8.5\"] >= 0}]\n set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]\n \n+set appname \"gitk\"\n+\n set runq {}\n set history {}\n set historyindex 0\n@@ -11220,7 +11230,7 @@ catch {\n }\n # wait for the window to become visible\n tkwait visibility .\n-wm title . \"[file tail $argv0]: [file tail [pwd]]\"\n+wm title . \"$appname: [reponame]\"\n update\n readrefs\n \n-- \n1.6.3.3\n"}]}