From 252c52df9d8d34692cb98a001491dd448e705901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gauthier=20=C3=96stervall?= Date: Wed, 27 Mar 2013 14:40:51 +0100 Subject: gitk: Move hard-coded colors to .gitk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Preferences dialog gives control of the colors of some elements of the gitk user interface, but many are hard-coded in the gitk script. In order to allow these to be customized through the gitk config file, these other colors are stored in variables which can be set in the config file, thus providing a way for color schemes to be stored and shared. For win32, this makes the default foreground color that of window text rather than button text. Signed-off-by: Gauthier Östervall [paulus@samba.org: Reworded commit message to be clearer, changed filesepfgcolor to black] Signed-off-by: Paul Mackerras --- gitk | 149 +++++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 110 insertions(+), 39 deletions(-) diff --git a/gitk b/gitk index b3706fc9b9..572f73f118 100755 --- a/gitk +++ b/gitk @@ -2026,6 +2026,9 @@ proc makewindow {} { global highlight_files gdttype global searchstring sstring global bgcolor fgcolor bglist fglist diffcolors selectbgcolor + global uifgcolor uifgdisabledcolor + global filesepbgcolor filesepfgcolor + global mergecolors foundbgcolor currentsearchhitbgcolor global headctxmenu progresscanv progressitem progresscoords statusw global fprogitem fprogcoord lastprogupdate progupdatepending global rprogitem rprogcoord rownumsel numcommits @@ -2177,10 +2180,10 @@ proc makewindow {} { 0x00, 0x38, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc0, 0x01}; } - image create bitmap bm-left -data $bm_left_data - image create bitmap bm-left-gray -data $bm_left_data -foreground "#999" - image create bitmap bm-right -data $bm_right_data - image create bitmap bm-right-gray -data $bm_right_data -foreground "#999" + image create bitmap bm-left -data $bm_left_data -foreground $uifgcolor + image create bitmap bm-left-gray -data $bm_left_data -foreground $uifgdisabledcolor + image create bitmap bm-right -data $bm_right_data -foreground $uifgcolor + image create bitmap bm-right-gray -data $bm_right_data -foreground $uifgdisabledcolor ${NS}::button .tf.bar.leftbut -command goback -state disabled -width 26 if {$use_ttk} { @@ -2349,32 +2352,32 @@ proc makewindow {} { lappend fglist $ctext $ctext tag conf comment -wrap $wrapcomment - $ctext tag conf filesep -font textfontbold -back "#aaaaaa" + $ctext tag conf filesep -font textfontbold -fore $filesepfgcolor -back $filesepbgcolor $ctext tag conf hunksep -fore [lindex $diffcolors 2] $ctext tag conf d0 -fore [lindex $diffcolors 0] $ctext tag conf dresult -fore [lindex $diffcolors 1] - $ctext tag conf m0 -fore red - $ctext tag conf m1 -fore blue - $ctext tag conf m2 -fore green - $ctext tag conf m3 -fore purple - $ctext tag conf m4 -fore brown - $ctext tag conf m5 -fore "#009090" - $ctext tag conf m6 -fore magenta - $ctext tag conf m7 -fore "#808000" - $ctext tag conf m8 -fore "#009000" - $ctext tag conf m9 -fore "#ff0080" - $ctext tag conf m10 -fore cyan - $ctext tag conf m11 -fore "#b07070" - $ctext tag conf m12 -fore "#70b0f0" - $ctext tag conf m13 -fore "#70f0b0" - $ctext tag conf m14 -fore "#f0b070" - $ctext tag conf m15 -fore "#ff70b0" + $ctext tag conf m0 -fore [lindex $mergecolors 0] + $ctext tag conf m1 -fore [lindex $mergecolors 1] + $ctext tag conf m2 -fore [lindex $mergecolors 2] + $ctext tag conf m3 -fore [lindex $mergecolors 3] + $ctext tag conf m4 -fore [lindex $mergecolors 4] + $ctext tag conf m5 -fore [lindex $mergecolors 5] + $ctext tag conf m6 -fore [lindex $mergecolors 6] + $ctext tag conf m7 -fore [lindex $mergecolors 7] + $ctext tag conf m8 -fore [lindex $mergecolors 8] + $ctext tag conf m9 -fore [lindex $mergecolors 9] + $ctext tag conf m10 -fore [lindex $mergecolors 10] + $ctext tag conf m11 -fore [lindex $mergecolors 11] + $ctext tag conf m12 -fore [lindex $mergecolors 12] + $ctext tag conf m13 -fore [lindex $mergecolors 13] + $ctext tag conf m14 -fore [lindex $mergecolors 14] + $ctext tag conf m15 -fore [lindex $mergecolors 15] $ctext tag conf mmax -fore darkgrey set mergemax 16 $ctext tag conf mresult -font textfontbold $ctext tag conf msep -font textfontbold - $ctext tag conf found -back yellow - $ctext tag conf currentsearchhit -back orange + $ctext tag conf found -back $foundbgcolor + $ctext tag conf currentsearchhit -back $currentsearchhitbgcolor $ctext tag conf wwrap -wrap word .pwbottom add .bleft @@ -2721,6 +2724,14 @@ proc savestuff {w} { 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 @@ -2753,13 +2764,37 @@ proc savestuff {w} { 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] puts $f "set geometry(main) [wm geometry .]" puts $f "set geometry(state) [wm state .]" @@ -5925,15 +5960,17 @@ proc drawcmittext {id row col} { global linehtag linentag linedtag selectedline global canvxmax boldids boldnameids fgcolor markedid global mainheadid nullid nullid2 circleitem circlecolors ctxbut + global mainheadcirclecolor workingfilescirclecolor indexcirclecolor + global circleoutlinecolor # listed is 0 for boundary, 1 for normal, 2 for negative, 3 for left, 4 for right set listed $cmitlisted($curview,$id) if {$id eq $nullid} { - set ofill red + set ofill $workingfilescirclecolor } elseif {$id eq $nullid2} { - set ofill green + set ofill $indexcirclecolor } elseif {$id eq $mainheadid} { - set ofill yellow + set ofill $mainheadcirclecolor } else { set ofill [lindex $circlecolors $listed] } @@ -5943,21 +5980,21 @@ proc drawcmittext {id row col} { if {$listed <= 2} { set t [$canv create oval [expr {$x - $orad}] [expr {$y - $orad}] \ [expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \ - -fill $ofill -outline $fgcolor -width 1 -tags circle] + -fill $ofill -outline $circleoutlinecolor -width 1 -tags circle] } elseif {$listed == 3} { # triangle pointing left for left-side commits set t [$canv create polygon \ [expr {$x - $orad}] $y \ [expr {$x + $orad - 1}] [expr {$y - $orad}] \ [expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \ - -fill $ofill -outline $fgcolor -width 1 -tags circle] + -fill $ofill -outline $circleoutlinecolor -width 1 -tags circle] } else { # triangle pointing right for right-side commits set t [$canv create polygon \ [expr {$x + $orad - 1}] $y \ [expr {$x - $orad}] [expr {$y - $orad}] \ [expr {$x - $orad}] [expr {$y + $orad - 1}] \ - -fill $ofill -outline $fgcolor -width 1 -tags circle] + -fill $ofill -outline $circleoutlinecolor -width 1 -tags circle] } set circleitem($row) $t $canv raise $t @@ -6345,6 +6382,9 @@ proc drawtags {id x xt y1} { global idtags idheads idotherrefs mainhead global linespc lthickness global canv rowtextx curview fgcolor bgcolor ctxbut + global headbgcolor headfgcolor headoutlinecolor remotebgcolor + global tagbgcolor tagfgcolor tagoutlinecolor + global reflinecolor set marks {} set ntags 0 @@ -6382,7 +6422,7 @@ proc drawtags {id x xt y1} { set xt [expr {$xt + $delta + $wid + $lthickness + $linespc}] } set t [$canv create line $x $y1 [lindex $xvals end] $y1 \ - -width $lthickness -fill black -tags tag.$id] + -width $lthickness -fill $reflinecolor -tags tag.$id] $canv lower $t foreach tag $marks x $xvals wid $wvals { set tag_quoted [string map {% %%} $tag] @@ -6393,13 +6433,14 @@ proc drawtags {id x xt y1} { # draw a tag set t [$canv create polygon $x [expr {$yt + $delta}] $xl $yt \ $xr $yt $xr $yb $xl $yb $x [expr {$yb - $delta}] \ - -width 1 -outline black -fill yellow -tags tag.$id] + -width 1 -outline $tagoutlinecolor -fill $tagbgcolor \ + -tags tag.$id] $canv bind $t <1> [list showtag $tag_quoted 1] set rowtextx([rowofcommit $id]) [expr {$xr + $linespc}] } else { # draw a head or other ref if {[incr nheads -1] >= 0} { - set col green + set col $headbgcolor if {$tag eq $mainhead} { set font mainfontbold } @@ -6415,10 +6456,10 @@ proc drawtags {id x xt y1} { set yti [expr {$yt + 1}] set xri [expr {$x + $rwid}] $canv create polygon $xi $yti $xri $yti $xri $yb $xi $yb \ - -width 0 -fill "#ffddaa" -tags tag.$id + -width 0 -fill $remotebgcolor -tags tag.$id } } - set t [$canv create text $xl $y1 -anchor w -text $tag -fill $fgcolor \ + set t [$canv create text $xl $y1 -anchor w -text $tag -fill $headfgcolor \ -font $font -tags [list tag.$id text]] if {$ntags >= 0} { $canv bind $t <1> [list showtag $tag_quoted 1] @@ -6799,6 +6840,7 @@ proc appendwithlinks {text tags} { proc setlink {id lk} { global curview ctext pendinglinks + global linkfgcolor if {[string range $id 0 1] eq "-g"} { set id [string range $id 2 end] @@ -6816,7 +6858,7 @@ proc setlink {id lk} { set known [commitinview $id $curview] } if {$known} { - $ctext tag conf $lk -foreground blue -underline 1 + $ctext tag conf $lk -foreground $linkfgcolor -underline 1 $ctext tag bind $lk <1> [list selbyid $id] $ctext tag bind $lk {linkcursor %W 1} $ctext tag bind $lk {linkcursor %W -1} @@ -8459,6 +8501,8 @@ proc lineleave {id} { proc linehover {} { global hoverx hovery hoverid hovertimer global canv linespc lthickness + global linehoverbgcolor linehoverfgcolor linehoveroutlinecolor + global commitinfo set text [lindex $commitinfo($hoverid) 0] @@ -8472,10 +8516,11 @@ proc linehover {} { set x1 [expr {$x + [font measure mainfont $text] + 2 * $lthickness}] set y1 [expr {$y + $linespc + 2 * $lthickness}] set t [$canv create rectangle $x0 $y0 $x1 $y1 \ - -fill \#ffff80 -outline black -width 1 -tags hover] + -fill $linehoverbgcolor -outline $linehoveroutlinecolor \ + -width 1 -tags hover] $canv raise $t set t [$canv create text $x $y -anchor nw -text $text -tags hover \ - -font mainfont] + -font mainfont -fill $linehoverfgcolor] $canv raise $t } @@ -9039,12 +9084,13 @@ proc domktag {} { proc redrawtags {id} { global canv linehtag idpos currentid curview cmitlisted markedid global canvxmax iddrawn circleitem mainheadid circlecolors + global mainheadcirclecolor if {![commitinview $id $curview]} return if {![info exists iddrawn($id)]} return set row [rowofcommit $id] if {$id eq $mainheadid} { - set ofill yellow + set ofill $mainheadcirclecolor } else { set ofill [lindex $circlecolors $cmitlisted($curview,$id)] } @@ -11728,22 +11774,47 @@ if {[tk windowingsystem] eq "aqua"} { set colors {green red blue magenta darkgrey brown orange} if {[tk windowingsystem] eq "win32"} { set uicolor SystemButtonFace + set uifgcolor SystemButtonText + set uifgdisabledcolor SystemDisabledText set bgcolor SystemWindow - set fgcolor SystemButtonText + set fgcolor SystemWindowText set selectbgcolor SystemHighlight } else { set uicolor grey85 + set uifgcolor black + set uifgdisabledcolor "#999" set bgcolor white set fgcolor black set selectbgcolor gray85 } set diffcolors {red "#00a000" blue} set diffcontext 3 +set mergecolors {red blue green purple brown "#009090" magenta "#808000" "#009000" "#ff0080" cyan "#b07070" "#70b0f0" "#70f0b0" "#f0b070" "#ff70b0"} set ignorespace 0 set worddiff "" set markbgcolor "#e0e0ff" +set headbgcolor green +set headfgcolor black +set headoutlinecolor black +set remotebgcolor #ffddaa +set tagbgcolor yellow +set tagfgcolor black +set tagoutlinecolor black +set reflinecolor black +set filesepbgcolor #aaaaaa +set filesepfgcolor black +set linehoverbgcolor #ffff80 +set linehoverfgcolor black +set linehoveroutlinecolor black +set mainheadcirclecolor yellow +set workingfilescirclecolor red +set indexcirclecolor green set circlecolors {white blue gray blue blue} +set linkfgcolor blue +set circleoutlinecolor $fgcolor +set foundbgcolor yellow +set currentsearchhitbgcolor orange # button for popping up context menus if {[tk windowingsystem] eq "aqua"} { -- cgit v1.2.3 From 39c126914b4b7365251f32d34926506c229f090e Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sat, 11 May 2013 17:08:41 +1000 Subject: gitk: Improve behaviour of drop-down lists The drop-down lists used for things like the criteria for finding commits (containing/touching paths/etc.) use a combobox if we are using the ttk widgets. By default the combobox exports its value as the selection when it is changed, which is unnecessary, and sometimes the combobox wouldn't release the selection, which is annoying. To fix this, we make these comboboxes not export their selection, and also clear their selection whenever they are changed. This makes them more like a simple selection of alternatives, improving the look and feel of gitk. Signed-off-by: Paul Mackerras --- gitk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 572f73f118..5ba2ce6ebc 100755 --- a/gitk +++ b/gitk @@ -1998,6 +1998,9 @@ proc mca {str} { return [string map {&& & & {}} [mc $str]] } +proc cleardropsel {w} { + $w selection clear +} proc makedroplist {w varname args} { global use_ttk if {$use_ttk} { @@ -2007,7 +2010,9 @@ proc makedroplist {w varname args} { if {$cx > $width} {set width $cx} } set gm [ttk::combobox $w -width $width -state readonly\ - -textvariable $varname -values $args] + -textvariable $varname -values $args \ + -exportselection false] + bind $gm <> [list $gm selection clear] } else { set gm [eval [linsert $args 0 tk_optionMenu $w $varname]] } -- cgit v1.2.3 From 685316c419caf4f4ec2e81e607d3e3ab089e329c Mon Sep 17 00:00:00 2001 From: Anand Kumria Date: Mon, 29 Apr 2013 06:20:48 +0100 Subject: gitk: Display the date of a tag in a human-friendly way By selecting a tag within gitk you can display information about it. This information is output by using the command 'git cat-file tag ' This outputs the *raw* information from the tag, amongst which is the time - in seconds since the epoch. As useful as that value is, I find it a lot easier to read and process time which it is something like: "Mon Dec 31 14:26:11 2012 -0800" This change will modify the display of tags in gitk like so: @@ -1,7 +1,7 @@ object 5d417842efeafb6e109db7574196901c4e95d273 type commit tag v1.8.1 -tagger Junio C Hamano 1356992771 -0800 +tagger Junio C Hamano Mon Dec 31 14:26:11 2012 -0800 Git 1.8.1 -----BEGIN PGP SIGNATURE----- Signed-off-by: Anand Kumria Signed-off-by: Paul Mackerras --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitk b/gitk index 5ba2ce6ebc..8d0501b48f 100755 --- a/gitk +++ b/gitk @@ -10831,7 +10831,7 @@ proc showtag {tag isnew} { set linknum 0 if {![info exists cached_tagcontent($tag)]} { catch { - set cached_tagcontent($tag) [exec git cat-file tag $tag] + set cached_tagcontent($tag) [exec git cat-file -p $tag] } } if {[info exists cached_tagcontent($tag)]} { -- cgit v1.2.3 From 2c8cd905d14e910de2a820178edf99b61f34a0c5 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 27 Apr 2013 17:01:39 -0500 Subject: gitk: Simplify file filtering git diff is perfectly able to do this with '-- files', no need for manual filtering. This makes gettreediffs consistent with getblobdiffs. Signed-off-by: Felipe Contreras Signed-off-by: Paul Mackerras --- gitk | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/gitk b/gitk index 8d0501b48f..b80a805e41 100755 --- a/gitk +++ b/gitk @@ -7618,9 +7618,13 @@ proc diffcmd {ids flags} { } proc gettreediffs {ids} { - global treediff treepending + global treediff treepending limitdiffs vfilelimit curview - if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return + set cmd [diffcmd $ids {--no-commit-id}] + if {$limitdiffs && $vfilelimit($curview) ne {}} { + set cmd [concat $cmd -- $vfilelimit($curview)] + } + if {[catch {set gdtf [open $cmd r]}]} return set treepending $ids set treediff {} @@ -7664,17 +7668,7 @@ proc gettreediffline {gdtf ids} { return [expr {$nr >= $max? 2: 1}] } close $gdtf - if {$limitdiffs && $vfilelimit($curview) ne {}} { - set flist {} - foreach f $treediff { - if {[path_filter $vfilelimit($curview) $f]} { - lappend flist $f - } - } - set treediffs($ids) $flist - } else { - set treediffs($ids) $treediff - } + set treediffs($ids) $treediff unset treepending if {$cmitmode eq "tree" && [llength $diffids] == 1} { gettree $diffids -- cgit v1.2.3 From 8f3ff9339fd0bdb797e072a1843bc5e9f766e4c6 Mon Sep 17 00:00:00 2001 From: Knut Franke Date: Sat, 27 Apr 2013 16:36:13 +0200 Subject: gitk: Add menu item for reverting commits Sometimes it's helpful (at least psychologically) to have this feature easily accessible. Code borrows heavily from cherrypick. Signed-off-by: Knut Franke Signed-off-by: Paul Mackerras --- gitk | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/gitk b/gitk index b80a805e41..9284c193c7 100755 --- a/gitk +++ b/gitk @@ -2567,6 +2567,7 @@ proc makewindow {} { {mc "Compare with marked commit" command compare_commits} {mc "Diff this -> marked commit" command {diffvsmark 0}} {mc "Diff marked commit -> this" command {diffvsmark 1}} + {mc "Revert this commit" command revert} } $rowctxmenu configure -tearoff 0 @@ -9346,6 +9347,67 @@ proc cherrypick {} { notbusy cherrypick } +proc revert {} { + global rowmenuid curview + global mainhead mainheadid + global gitdir + + set oldhead [exec git rev-parse HEAD] + set dheads [descheads $rowmenuid] + if { $dheads eq {} || [lsearch -exact $dheads $oldhead] == -1 } { + set ok [confirm_popup [mc "Commit %s is not\ + included in branch %s -- really revert it?" \ + [string range $rowmenuid 0 7] $mainhead]] + if {!$ok} return + } + nowbusy revert [mc "Reverting"] + update + + if [catch {exec git revert --no-edit $rowmenuid} err] { + notbusy revert + if [regexp {files would be overwritten by merge:(\n(( |\t)+[^\n]+\n)+)}\ + $err match files] { + regsub {\n( |\t)+} $files "\n" files + error_popup [mc "Revert failed because of local changes to\ + the following files:%s Please commit, reset or stash \ + your changes and try again." $files] + } elseif [regexp {error: could not revert} $err] { + if [confirm_popup [mc "Revert failed because of merge conflict.\n\ + Do you wish to run git citool to resolve it?"]] { + # Force citool to read MERGE_MSG + file delete [file join $gitdir "GITGUI_MSG"] + exec_citool {} $rowmenuid + } + } else { error_popup $err } + run updatecommits + return + } + + set newhead [exec git rev-parse HEAD] + if { $newhead eq $oldhead } { + notbusy revert + error_popup [mc "No changes committed"] + return + } + + addnewchild $newhead $oldhead + + if [commitinview $oldhead $curview] { + # XXX this isn't right if we have a path limit... + insertrow $newhead $oldhead $curview + if {$mainhead ne {}} { + movehead $newhead $mainhead + movedhead $newhead $mainhead + } + set mainheadid $newhead + redrawtags $oldhead + redrawtags $newhead + selbyid $newhead + } + + notbusy revert +} + proc resethead {} { global mainhead rowmenuid confirm_ok resettype NS -- cgit v1.2.3 From c33cb9083ecad2ec7e23b00722096a94e62b17e1 Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Thu, 14 Jun 2012 20:34:11 +0200 Subject: gitk: Add support for -G'regex' pickaxe variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git log -G'regex' is a very useful alternative to the classic pickaxe. Minimal patch to make it usable from gitk. [zj: reword message] [paulus@samba.org: reword droplist item] Signed-off-by: Zbigniew Jędrzejewski-Szmek Signed-off-by: Paul Mackerras --- gitk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 9284c193c7..22a05b0373 100755 --- a/gitk +++ b/gitk @@ -2253,7 +2253,8 @@ proc makewindow {} { set gm [makedroplist .tf.lbar.gdttype gdttype \ [mc "containing:"] \ [mc "touching paths:"] \ - [mc "adding/removing string:"]] + [mc "adding/removing string:"] \ + [mc "changing lines matching:"]] trace add variable gdttype write gdttype_change pack .tf.lbar.gdttype -side left -fill y @@ -4658,6 +4659,8 @@ proc do_file_hl {serial} { set gdtargs [concat -- $relative_paths] } elseif {$gdttype eq [mc "adding/removing string:"]} { set gdtargs [list "-S$highlight_files"] + } elseif {$gdttype eq [mc "changing lines matching:"]} { + set gdtargs [list "-G$highlight_files"] } else { # must be "containing:", i.e. we're searching commit info return -- cgit v1.2.3 From 76bf6ff93e1766b8813f0cdbe9089080010ba646 Mon Sep 17 00:00:00 2001 From: Tair Sabirgaliev Date: Wed, 24 Apr 2013 15:48:27 +0600 Subject: gitk: On OSX, bring the gitk window to front On OSX, Tcl/Tk application windows are created behind all the applications down the stack of windows. This is very annoying, because once a gitk window appears, it's the downmost window and switching to it is pain. The patch is: if we are on OSX, use osascript to bring the current Wish process window to front. Signed-off-by: Tair Sabirgaliev Thanks-to: Stefan Haller Signed-off-by: Paul Mackerras --- gitk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gitk b/gitk index 22a05b0373..5cd00d80fe 100755 --- a/gitk +++ b/gitk @@ -11751,6 +11751,15 @@ if {[catch {package require Tk 8.4} err]} { exit 1 } +# on OSX bring the current Wish process window to front +if {[tk windowingsystem] eq "aqua"} { + exec osascript -e [format { + tell application "System Events" + set frontmost of processes whose unix id is %d to true + end tell + } [pid] ] +} + # Unset GIT_TRACE var if set if { [info exists ::env(GIT_TRACE)] } { unset ::env(GIT_TRACE) -- cgit v1.2.3