diff --git a/gitk-git/gitk b/gitk-git/gitk index 64ef3c401367c9..d3b5a28371ee2c 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -9,6 +9,17 @@ exec wish "$0" -- "$@" package require Tk +if { $argc >=2 && [lindex $argv 0] == "--working-dir" } { + set workdir [lindex $argv 1] + cd $workdir + if {[lindex [file split $workdir] end] eq {.git}} { + # Workaround for Explorer right click "Gitk --all Here" on .git/ + cd .. + } + set argv [lrange $argv 2 end] + incr argc -2 +} + proc hasworktree {} { return [expr {[exec git rev-parse --is-bare-repository] == "false" && [exec git rev-parse --is-inside-git-dir] == "false"}] @@ -9312,7 +9323,7 @@ proc showrefs {} { text $top.list -background $bgcolor -foreground $fgcolor \ -selectbackground $selectbgcolor -font mainfont \ -xscrollcommand "$top.xsb set" -yscrollcommand "$top.ysb set" \ - -width 30 -height 20 -cursor $maincursor \ + -width 60 -height 20 -cursor $maincursor \ -spacing1 1 -spacing3 1 -state disabled $top.list tag configure highlight -background $selectbgcolor lappend bglist $top.list