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

[PATCH] gitk: show detached HEAD if --all is specified

From
Max Kirillov <max@max630.net>
Date
Sep 9, 2014, 07:29 UTC
Message-ID
<1410247756-10879-1-git-send-email-max@max630.net>

If HEAD is detached, 'gitk --all' does not show it. This is inconvenient for frontend program, and for example git log does show the detached HEAD.

gitk uses git rev-parse to find a list of branches to show. Apparently, the command does not include detached HEAD to output if --all argument is specified. This has been discussed in [1] and stated as expected behavior. So rev-parse's parameters should be tuned in gitk.

[1] http://thread.gmane.org/gmane.comp.version-control.git/255996
Signed-off-by: Max Kirillov <max@max630.net>
---
 gitk | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/gitk b/gitk
index c8df35d..a5d98bf 100755
--- a/gitk
+++ b/gitk
@@ -294,6 +294,8 @@ proc parseviewrevs {view revs} {
 
     if {$revs eq {}} {
 	set revs HEAD
+    } elseif {[lsearch -exact $revs --all] >= 0} {
+	lappend revs HEAD
     }
     if {[catch {set ids [eval exec git rev-parse $revs]} err]} {
 	# we get stdout followed by stderr in $err
-- 
2.0.1.1697.g73c6810
Next: Junio C Hamano
Message 1 of 3 in “gitk: show detached HEAD if --all is specified”
  1. gitk: show detached HEAD if --all is specifiedMax Kirillov, Sep 9, 2014
  2. Junio C HamanoSep 9, 2014
  3. Junio C HamanoSep 9, 2014

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.