Skip to content

Commit

Permalink
gitk: Show detached HEAD if --all is specified
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Max Kirillov authored and Paul Mackerras committed Oct 29, 2014
1 parent 7b68b0e commit 4d5e1b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4d5e1b1

Please sign in to comment.