From a436c24dbd9f912391a494c1eaeb3eeeac0647b2 Mon Sep 17 00:00:00 2001 From: windwiny Date: Thu, 2 Feb 2012 22:24:06 +0800 Subject: [PATCH 1/2] default "List tags and heads" window too small --- gitk-git/gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index 64ef3c401367c9..86153a703c1e07 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -9312,7 +9312,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 From 9557637a49af7c37315b4f55a7b4e13304669abf Mon Sep 17 00:00:00 2001 From: windwiny Date: Fri, 3 Feb 2012 14:09:23 +0800 Subject: [PATCH 2/2] add gitk --working-dir param --- gitk-git/gitk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gitk-git/gitk b/gitk-git/gitk index 86153a703c1e07..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"}]