diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-10-30 10:07:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-30 10:07:33 -0700 |
commit | 81d645d1a10104f23c7d3e90eb24fdb672e9694c (patch) | |
tree | 90ecd5d9035fa14c39dfd516513586e5b42775d4 /gitk-git | |
parent | 36666ce4da5b56669a70afa611453a2fa84f97f8 (diff) | |
parent | 9fabefb1f3f658e77eb18afa3f95efe1a0ee8d0d (diff) | |
download | git-81d645d1a10104f23c7d3e90eb24fdb672e9694c.tar.gz |
Merge git://ozlabs.org/~paulus/gitk
* git://ozlabs.org/~paulus/gitk:
gitk: Remove boilerplate for configuration variables
gitk: Show detached HEAD if --all is specified
gitk: Do not depend on Cygwin's "kill" command on Windows
Diffstat (limited to 'gitk-git')
-rwxr-xr-x | gitk-git/gitk | 92 |
1 files changed, 23 insertions, 69 deletions
diff --git a/gitk-git/gitk b/gitk-git/gitk index 3520bdaebc..78358a712a 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -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 @@ -445,7 +447,7 @@ proc stop_instance {inst} { set pid [pid $fd] if {$::tcl_platform(platform) eq {windows}} { - exec kill -f $pid + exec taskkill /pid $pid } else { exec kill $pid } @@ -2775,23 +2777,11 @@ proc doprogupdate {} { } proc savestuff {w} { - global canv canv2 canv3 mainfont textfont uifont tabstop - global stuffsaved findmergefiles maxgraphpct - global maxwidth showneartags showlocalchanges global viewname viewfiles viewargs viewargscmd viewperm nextviewnum - global cmitmode wrapcomment datetimeformat limitdiffs - global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor - global uifgcolor uifgdisabledcolor - global headbgcolor headfgcolor headoutlinecolor remotebgcolor - global tagbgcolor tagfgcolor tagoutlinecolor - global reflinecolor filesepbgcolor filesepfgcolor - global mergecolors foundbgcolor currentsearchhitbgcolor - global linehoverbgcolor linehoverfgcolor linehoveroutlinecolor circlecolors - global mainheadcirclecolor workingfilescirclecolor indexcirclecolor - global linkfgcolor circleoutlinecolor - global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk - global hideremotes want_ttk maxrefs visiblerefs + global use_ttk + global stuffsaved global config_file config_file_tmp + global config_variables if {$stuffsaved} return if {![winfo viewable .]} return @@ -2803,59 +2793,10 @@ proc savestuff {w} { if {$::tcl_platform(platform) eq {windows}} { file attributes $config_file_tmp -hidden true } - puts $f [list set mainfont $mainfont] - puts $f [list set textfont $textfont] - puts $f [list set uifont $uifont] - puts $f [list set tabstop $tabstop] - puts $f [list set findmergefiles $findmergefiles] - puts $f [list set maxgraphpct $maxgraphpct] - puts $f [list set maxwidth $maxwidth] - puts $f [list set cmitmode $cmitmode] - puts $f [list set wrapcomment $wrapcomment] - puts $f [list set autoselect $autoselect] - puts $f [list set autosellen $autosellen] - puts $f [list set showneartags $showneartags] - puts $f [list set maxrefs $maxrefs] - puts $f [list set visiblerefs $visiblerefs] - puts $f [list set hideremotes $hideremotes] - puts $f [list set showlocalchanges $showlocalchanges] - puts $f [list set datetimeformat $datetimeformat] - puts $f [list set limitdiffs $limitdiffs] - puts $f [list set uicolor $uicolor] - puts $f [list set want_ttk $want_ttk] - puts $f [list set bgcolor $bgcolor] - puts $f [list set fgcolor $fgcolor] - puts $f [list set uifgcolor $uifgcolor] - puts $f [list set uifgdisabledcolor $uifgdisabledcolor] - puts $f [list set colors $colors] - puts $f [list set diffcolors $diffcolors] - puts $f [list set mergecolors $mergecolors] - puts $f [list set markbgcolor $markbgcolor] - puts $f [list set diffcontext $diffcontext] - puts $f [list set selectbgcolor $selectbgcolor] - puts $f [list set foundbgcolor $foundbgcolor] - puts $f [list set currentsearchhitbgcolor $currentsearchhitbgcolor] - puts $f [list set extdifftool $extdifftool] - puts $f [list set perfile_attrs $perfile_attrs] - puts $f [list set headbgcolor $headbgcolor] - puts $f [list set headfgcolor $headfgcolor] - puts $f [list set headoutlinecolor $headoutlinecolor] - puts $f [list set remotebgcolor $remotebgcolor] - puts $f [list set tagbgcolor $tagbgcolor] - puts $f [list set tagfgcolor $tagfgcolor] - puts $f [list set tagoutlinecolor $tagoutlinecolor] - puts $f [list set reflinecolor $reflinecolor] - puts $f [list set filesepbgcolor $filesepbgcolor] - puts $f [list set filesepfgcolor $filesepfgcolor] - puts $f [list set linehoverbgcolor $linehoverbgcolor] - puts $f [list set linehoverfgcolor $linehoverfgcolor] - puts $f [list set linehoveroutlinecolor $linehoveroutlinecolor] - puts $f [list set mainheadcirclecolor $mainheadcirclecolor] - puts $f [list set workingfilescirclecolor $workingfilescirclecolor] - puts $f [list set indexcirclecolor $indexcirclecolor] - puts $f [list set circlecolors $circlecolors] - puts $f [list set linkfgcolor $linkfgcolor] - puts $f [list set circleoutlinecolor $circleoutlinecolor] + foreach var_name $config_variables { + upvar #0 $var_name var + puts $f [list set $var_name $var] + } puts $f "set geometry(main) [wm geometry .]" puts $f "set geometry(state) [wm state .]" @@ -12169,6 +12110,19 @@ catch { source $config_file } +set config_variables { + mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth + cmitmode wrapcomment autoselect autosellen showneartags maxrefs visiblerefs + hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk + bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors + markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor + extdifftool perfile_attrs headbgcolor headfgcolor headoutlinecolor + remotebgcolor tagbgcolor tagfgcolor tagoutlinecolor reflinecolor + filesepbgcolor filesepfgcolor linehoverbgcolor linehoverfgcolor + linehoveroutlinecolor mainheadcirclecolor workingfilescirclecolor + indexcirclecolor circlecolors linkfgcolor circleoutlinecolor +} + parsefont mainfont $mainfont eval font create mainfont [fontflags mainfont] eval font create mainfontbold [fontflags mainfont 1] |