Skip to content

Commit 4d5e1b1

Browse files
max630paulusmack
authored andcommitted
gitk: Show detached HEAD if --all is specified
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 7b68b0e commit 4d5e1b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gitk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ proc parseviewrevs {view revs} {
294294

295295
if {$revs eq {}} {
296296
set revs HEAD
297+
} elseif {[lsearch -exact $revs --all] >= 0} {
298+
lappend revs HEAD
297299
}
298300
if {[catch {set ids [eval exec git rev-parse $revs]} err]} {
299301
# we get stdout followed by stderr in $err

0 commit comments

Comments
 (0)