git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] gitk: Show the rev(s) the user specified on the command line in the window title.

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Mar 23, 2015, 14:18 UTC
Message-ID
<1427120297-26314-2-git-send-email-marcnarc@xiplink.com>
In-Reply-To
<1427120297-26314-1-git-send-email-marcnarc@xiplink.com>
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
---

I often open multiple gitk windows in the same working directory to examine other branches or refs in the repo. This change allows me to distinguish which window is showing what.

		M.
 gitk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gitk b/gitk
index b859879..379b13a 100755
--- a/gitk
+++ b/gitk
@@ -488,7 +488,7 @@ proc reset_pending_select {selid} {
 }
 
 proc getcommits {selid} {
-    global canv curview need_redisplay viewactive
+    global appname canv curview need_redisplay viewactive vrevs
 
     initlayout
     if {[start_rev_list $curview]} {
@@ -498,6 +498,11 @@ proc getcommits {selid} {
     } else {
 	show_status [mc "No commits selected"]
     }
+    set rev "$vrevs($curview)"
+    if {$rev eq ""} {
+	set rev "HEAD"
+    }
+    wm title . "[reponame]: $rev - $appname"
 }
 
 proc updatecommits {} {
-- 
2.3.3
Previous: Marc BranchaudNext: Paul Mackerras
Message 11 of 12 in “Tweaking the gitk window title.”
  1. 0/2 Tweaking the gitk window title.Marc Branchaud, Jan 6, 2015
  2. 1/2 gitk: Rearrange window title to be more conventional.Marc Branchaud, Jan 6, 2015
  3. 2/2 gitk: Show the rev(s) the user specified on the command line in the window title.Marc Branchaud, Jan 6, 2015
  4. Paul MackerrasApr 6, 2015
  5. [PATCHv2] gitk: Show the current view's name in the window title.Marc Branchaud, Apr 7, 2015
  6. Marc BranchaudMay 4, 2015
  7. Paul MackerrasMay 17, 2015
  8. Marc BranchaudJan 26, 2015
  9. Marc BranchaudMar 2, 2015
  10. 1/2 gitk: Rearrange window title to be more conventional.Marc Branchaud, Mar 23, 2015
  11. 2/2 gitk: Show the rev(s) the user specified on the command line in the window title.Marc Branchaud, Mar 23, 2015
  12. Paul MackerrasApr 6, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.