{"thread":{"id":"37523","subject":"[PATCH] gitk: show detached HEAD if --all is specified","startedAt":"2014-09-09T07:29:16Z","lastAt":"2014-09-09T17:04:06Z","messageCount":3,"participants":["Max Kirillov","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"249072","messageId":"1410247756-10879-1-git-send-email-max@max630.net","threadId":"37523","inReplyTo":null,"subject":"[PATCH] gitk: show detached HEAD if --all is specified","fromName":"Max Kirillov","fromEmail":"max@max630.net","sentAt":"2014-09-09T07:29:16Z","receivedAt":"2014-09-09T07:29:16Z","isPatch":true,"sender":{"key":"max@max630.net","avatar":"https://avatars.githubusercontent.com/u/381560?v=4"},"body":"If HEAD is detached, 'gitk --all' does not show it. This is inconvenient\nfor frontend program, and for example git log does show the detached HEAD.\n\ngitk uses git rev-parse to find a list of branches to show.\nApparently, the command does not include detached HEAD to output if\n--all argument is specified. This has been discussed in [1] and stated\nas expected behavior. So rev-parse's parameters should be tuned in gitk.\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/255996\n\nSigned-off-by: Max Kirillov <max@max630.net>\n---\n gitk | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/gitk b/gitk\nindex c8df35d..a5d98bf 100755\n--- a/gitk\n+++ b/gitk\n@@ -294,6 +294,8 @@ proc parseviewrevs {view revs} {\n \n     if {$revs eq {}} {\n \tset revs HEAD\n+    } elseif {[lsearch -exact $revs --all] >= 0} {\n+\tlappend revs HEAD\n     }\n     if {[catch {set ids [eval exec git rev-parse $revs]} err]} {\n \t# we get stdout followed by stderr in $err\n-- \n2.0.1.1697.g73c6810\n"},{"id":"249078","messageId":"xmqqppf4loaq.fsf@gitster.dls.corp.google.com","threadId":"37523","inReplyTo":"1410247756-10879-1-git-send-email-max@max630.net","subject":"Re: [PATCH] gitk: show detached HEAD if --all is specified","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-09T17:02:53Z","receivedAt":"2014-09-09T17:02:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Max Kirillov <max@max630.net> writes:\n\n> If HEAD is detached, 'gitk --all' does not show it. This is inconvenient\n> for frontend program, and for example git log does show the detached HEAD.\n\n\"git log\" does use the same revision machinery as rev-parse uses\ninternally to parse its command line arguments.  What does it do\ndifferently?\n"},{"id":"249079","messageId":"xmqqlhpslo8p.fsf@gitster.dls.corp.google.com","threadId":"37523","inReplyTo":"xmqqppf4loaq.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] gitk: show detached HEAD if --all is specified","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-09T17:04:06Z","receivedAt":"2014-09-09T17:04:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Max Kirillov <max@max630.net> writes:\n>\n>> If HEAD is detached, 'gitk --all' does not show it. This is inconvenient\n>> for frontend program, and for example git log does show the detached HEAD.\n>\n> \"git log\" does use the same revision machinery as rev-parse uses\n> internally to parse its command line arguments.  What does it do\n> differently?\n\nAh, nevermind.  I misremembered that rev-parse does not use the\nrevision machinery.\n"}]}