{"thread":{"id":"28895","subject":"[PATCH] gitk: use \"gitk: repo-top-level-dir\" as window title","startedAt":"2011-11-09T16:28:28Z","lastAt":"2012-03-18T23:01:40Z","messageCount":2,"participants":["Zbigniew Jędrzejewski-Szmek","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"179211","messageId":"1320856108-25233-1-git-send-email-zbyszek@in.waw.pl","threadId":"28895","inReplyTo":null,"subject":"[PATCH] gitk: use \"gitk: repo-top-level-dir\" as window title","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2011-11-09T16:28:28Z","receivedAt":"2011-11-09T16:28:28Z","isPatch":true,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"Previously, when run in a subdirectory, gitk would show the name\nof this subdirectory as title, which was misleading. When run with\nGIT_DIR set, it would show the cwd, which is even more misleading.\n\nIn case of non-bare repos, the .git suffix in the path is skipped.\n\nSigned-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\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 4cde0c4..2eaf901 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -18,6 +18,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 [file tail $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@@ -11592,6 +11600,8 @@ if {[package vcompare $git_version \"1.6.6.2\"] >= 0} {\n     set show_notes \"--show-notes\"\n }\n \n+set appname \"gitk\"\n+\n set runq {}\n set history {}\n set historyindex 0\n@@ -11656,7 +11666,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.7.8.rc0.251.gccd63\n"},{"id":"187221","messageId":"20120318230140.GB26977@bloggs.ozlabs.ibm.com","threadId":"28895","inReplyTo":"1320856108-25233-1-git-send-email-zbyszek@in.waw.pl","subject":"Re: [PATCH] gitk: use \"gitk: repo-top-level-dir\" as window title","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2012-03-18T23:01:40Z","receivedAt":"2012-03-18T23:01:40Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Wed, Nov 09, 2011 at 05:28:28PM +0100, Zbigniew Jędrzejewski-Szmek wrote:\n> Previously, when run in a subdirectory, gitk would show the name\n> of this subdirectory as title, which was misleading. When run with\n> GIT_DIR set, it would show the cwd, which is even more misleading.\n> \n> In case of non-bare repos, the .git suffix in the path is skipped.\n> \n> Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>\n\nThanks, applied, with the patch fixed to use $gitdir not [gitdir]\n(needed since 86e847bc removed [gitdir]).\n\nPaul.\n"}]}