Skip to content

Commit 585fb59

Browse files
committed
Merge branch 'master' into dev
2 parents f1bf4ee + 6675ea4 commit 585fb59

File tree

5 files changed

+427
-254
lines changed

5 files changed

+427
-254
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
1818

1919
## po-file creation rules
2020
XGETTEXT ?= xgettext
21-
MSGFMT ?= msgfmt
21+
ifdef NO_MSGFMT
22+
MSGFMT ?= $(TCL_PATH) po/po2msg.sh
23+
else
24+
MSGFMT ?= msgfmt
25+
endif
26+
2227
PO_TEMPLATE = po/gitk.pot
2328
ALL_POFILES = $(wildcard po/*.po)
2429
ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))

gitk

Lines changed: 67 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,11 +1039,12 @@ proc getcommitlines {fd inst view} {
10391039
set listed 1
10401040
if {$j >= 0 && [string match "commit *" $cmit]} {
10411041
set ids [string range $cmit 7 [expr {$j - 1}]]
1042-
if {[string match {[-<>]*} $ids]} {
1042+
if {[string match {[-^<>]*} $ids]} {
10431043
switch -- [string index $ids 0] {
10441044
"-" {set listed 0}
1045-
"<" {set listed 2}
1046-
">" {set listed 3}
1045+
"^" {set listed 2}
1046+
"<" {set listed 3}
1047+
">" {set listed 4}
10471048
}
10481049
set ids [string range $ids 1 end]
10491050
}
@@ -1412,6 +1413,7 @@ proc makewindow {} {
14121413
global findtype findtypemenu findloc findstring fstring geometry
14131414
global entries sha1entry sha1string sha1but
14141415
global diffcontextstring diffcontext
1416+
global ignorespace
14151417
global maincursor textcursor curtextcursor
14161418
global rowctxmenu fakerowmenu mergemax wrapcomment
14171419
global highlight_files gdttype
@@ -1630,6 +1632,9 @@ proc makewindow {} {
16301632
trace add variable diffcontextstring write diffcontextchange
16311633
lappend entries .bleft.mid.diffcontext
16321634
pack .bleft.mid.labeldiffcontext .bleft.mid.diffcontext -side left
1635+
checkbutton .bleft.mid.ignspace -text [mc "Ignore space change"] \
1636+
-command changeignorespace -variable ignorespace
1637+
pack .bleft.mid.ignspace -side left -padx 5
16331638
set ctext .bleft.ctext
16341639
text $ctext -background $bgcolor -foreground $fgcolor \
16351640
-state disabled -font textfont \
@@ -1777,6 +1782,7 @@ proc makewindow {} {
17771782
bind . <$M1B-r> dosearchback
17781783
bind . <$M1B-s> dosearch
17791784
bind . <$M1B-equal> {incrfont 1}
1785+
bind . <$M1B-plus> {incrfont 1}
17801786
bind . <$M1B-KP_Add> {incrfont 1}
17811787
bind . <$M1B-minus> {incrfont -1}
17821788
bind . <$M1B-KP_Subtract> {incrfont -1}
@@ -2087,45 +2093,45 @@ proc keys {} {
20872093
}
20882094
toplevel $w
20892095
wm title $w [mc "Gitk key bindings"]
2090-
message $w.m -text [mc "
2091-
Gitk key bindings:
2092-
2093-
<$M1T-Q> Quit
2094-
<Home> Move to first commit
2095-
<End> Move to last commit
2096-
<Up>, p, i Move up one commit
2097-
<Down>, n, k Move down one commit
2098-
<Left>, z, j Go back in history list
2099-
<Right>, x, l Go forward in history list
2100-
<PageUp> Move up one page in commit list
2101-
<PageDown> Move down one page in commit list
2102-
<$M1T-Home> Scroll to top of commit list
2103-
<$M1T-End> Scroll to bottom of commit list
2104-
<$M1T-Up> Scroll commit list up one line
2105-
<$M1T-Down> Scroll commit list down one line
2106-
<$M1T-PageUp> Scroll commit list up one page
2107-
<$M1T-PageDown> Scroll commit list down one page
2108-
<Shift-Up> Find backwards (upwards, later commits)
2109-
<Shift-Down> Find forwards (downwards, earlier commits)
2110-
<Delete>, b Scroll diff view up one page
2111-
<Backspace> Scroll diff view up one page
2112-
<Space> Scroll diff view down one page
2113-
u Scroll diff view up 18 lines
2114-
d Scroll diff view down 18 lines
2115-
<$M1T-F> Find
2116-
<$M1T-G> Move to next find hit
2117-
<Return> Move to next find hit
2118-
/ Move to next find hit, or redo find
2119-
? Move to previous find hit
2120-
f Scroll diff view to next file
2121-
<$M1T-S> Search for next hit in diff view
2122-
<$M1T-R> Search for previous hit in diff view
2123-
<$M1T-KP+> Increase font size
2124-
<$M1T-plus> Increase font size
2125-
<$M1T-KP-> Decrease font size
2126-
<$M1T-minus> Decrease font size
2127-
<F5> Update
2128-
"] \
2096+
message $w.m -text "
2097+
[mc "Gitk key bindings:"]
2098+
2099+
[mc "<%s-Q> Quit" $M1T]
2100+
[mc "<Home> Move to first commit"]
2101+
[mc "<End> Move to last commit"]
2102+
[mc "<Up>, p, i Move up one commit"]
2103+
[mc "<Down>, n, k Move down one commit"]
2104+
[mc "<Left>, z, j Go back in history list"]
2105+
[mc "<Right>, x, l Go forward in history list"]
2106+
[mc "<PageUp> Move up one page in commit list"]
2107+
[mc "<PageDown> Move down one page in commit list"]
2108+
[mc "<%s-Home> Scroll to top of commit list" $M1T]
2109+
[mc "<%s-End> Scroll to bottom of commit list" $M1T]
2110+
[mc "<%s-Up> Scroll commit list up one line" $M1T]
2111+
[mc "<%s-Down> Scroll commit list down one line" $M1T]
2112+
[mc "<%s-PageUp> Scroll commit list up one page" $M1T]
2113+
[mc "<%s-PageDown> Scroll commit list down one page" $M1T]
2114+
[mc "<Shift-Up> Find backwards (upwards, later commits)"]
2115+
[mc "<Shift-Down> Find forwards (downwards, earlier commits)"]
2116+
[mc "<Delete>, b Scroll diff view up one page"]
2117+
[mc "<Backspace> Scroll diff view up one page"]
2118+
[mc "<Space> Scroll diff view down one page"]
2119+
[mc "u Scroll diff view up 18 lines"]
2120+
[mc "d Scroll diff view down 18 lines"]
2121+
[mc "<%s-F> Find" $M1T]
2122+
[mc "<%s-G> Move to next find hit" $M1T]
2123+
[mc "<Return> Move to next find hit"]
2124+
[mc "/ Move to next find hit, or redo find"]
2125+
[mc "? Move to previous find hit"]
2126+
[mc "f Scroll diff view to next file"]
2127+
[mc "<%s-S> Search for next hit in diff view" $M1T]
2128+
[mc "<%s-R> Search for previous hit in diff view" $M1T]
2129+
[mc "<%s-KP+> Increase font size" $M1T]
2130+
[mc "<%s-plus> Increase font size" $M1T]
2131+
[mc "<%s-KP-> Decrease font size" $M1T]
2132+
[mc "<%s-minus> Decrease font size" $M1T]
2133+
[mc "<F5> Update"]
2134+
" \
21292135
-justify left -bg white -border 2 -relief groove
21302136
pack $w.m -side top -fill both -padx 2 -pady 2
21312137
button $w.ok -text [mc "Close"] -command "destroy $w" -default active
@@ -3365,12 +3371,12 @@ proc askrelhighlight {row id} {
33653371

33663372
if {![info exists selectedline]} return
33673373
set isbold 0
3368-
if {$highlight_related eq [mc "Descendent"] ||
3369-
$highlight_related eq [mc "Not descendent"]} {
3374+
if {$highlight_related eq [mc "Descendant"] ||
3375+
$highlight_related eq [mc "Not descendant"]} {
33703376
if {![info exists descendent($id)]} {
33713377
is_descendent $id
33723378
}
3373-
if {$descendent($id) == ($highlight_related eq [mc "Descendent"])} {
3379+
if {$descendent($id) == ($highlight_related eq [mc "Descendant"])} {
33743380
set isbold 1
33753381
}
33763382
} elseif {$highlight_related eq [mc "Ancestor"] ||
@@ -4386,23 +4392,23 @@ proc drawcmittext {id row col} {
43864392
global linehtag linentag linedtag selectedline
43874393
global canvxmax boldrows boldnamerows fgcolor nullid nullid2
43884394

4389-
# listed is 0 for boundary, 1 for normal, 2 for left, 3 for right
4395+
# listed is 0 for boundary, 1 for normal, 2 for negative, 3 for left, 4 for right
43904396
set listed $cmitlisted($curview,$id)
43914397
if {$id eq $nullid} {
43924398
set ofill red
43934399
} elseif {$id eq $nullid2} {
43944400
set ofill green
43954401
} else {
4396-
set ofill [expr {$listed != 0? "blue": "white"}]
4402+
set ofill [expr {$listed != 0 ? $listed == 2 ? "gray" : "blue" : "white"}]
43974403
}
43984404
set x [xc $row $col]
43994405
set y [yc $row]
44004406
set orad [expr {$linespc / 3}]
4401-
if {$listed <= 1} {
4407+
if {$listed <= 2} {
44024408
set t [$canv create oval [expr {$x - $orad}] [expr {$y - $orad}] \
44034409
[expr {$x + $orad - 1}] [expr {$y + $orad - 1}] \
44044410
-fill $ofill -outline $fgcolor -width 1 -tags circle]
4405-
} elseif {$listed == 2} {
4411+
} elseif {$listed == 3} {
44064412
# triangle pointing left for left-side commits
44074413
set t [$canv create polygon \
44084414
[expr {$x - $orad}] $y \
@@ -5775,12 +5781,13 @@ proc mergediff {id} {
57755781
global diffmergeid mdifffd
57765782
global diffids
57775783
global parents
5784+
global diffcontext
57785785
global limitdiffs viewfiles curview
57795786

57805787
set diffmergeid $id
57815788
set diffids $id
57825789
# this doesn't seem to actually affect anything...
5783-
set cmd [concat | git diff-tree --no-commit-id --cc $id]
5790+
set cmd [concat | git diff-tree --no-commit-id --cc -U$diffcontext $id]
57845791
if {$limitdiffs && $viewfiles($curview) ne {}} {
57855792
set cmd [concat $cmd -- $viewfiles($curview)]
57865793
}
@@ -6017,13 +6024,21 @@ proc diffcontextchange {n1 n2 op} {
60176024
}
60186025
}
60196026

6027+
proc changeignorespace {} {
6028+
reselectline
6029+
}
6030+
60206031
proc getblobdiffs {ids} {
60216032
global blobdifffd diffids env
60226033
global diffinhdr treediffs
60236034
global diffcontext
6035+
global ignorespace
60246036
global limitdiffs viewfiles curview
60256037

60266038
set cmd [diffcmd $ids "-p -C --no-commit-id -U$diffcontext"]
6039+
if {$ignorespace} {
6040+
append cmd " -w"
6041+
}
60276042
if {$limitdiffs && $viewfiles($curview) ne {}} {
60286043
set cmd [concat $cmd -- $viewfiles($curview)]
60296044
}
@@ -6878,11 +6893,7 @@ proc domktag {} {
68786893
return
68796894
}
68806895
if {[catch {
6881-
set dir [gitdir]
6882-
set fname [file join $dir "refs/tags" $tag]
6883-
set f [open $fname w]
6884-
puts $f $id
6885-
close $f
6896+
exec git tag $tag $id
68866897
} err]} {
68876898
error_popup "[mc "Error creating tag:"] $err"
68886899
return
@@ -9210,6 +9221,7 @@ set bgcolor white
92109221
set fgcolor black
92119222
set diffcolors {red "#00a000" blue}
92129223
set diffcontext 3
9224+
set ignorespace 0
92139225
set selectbgcolor gray85
92149226

92159227
## For msgcat loading, first locate the installation location.

po/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.msg

0 commit comments

Comments
 (0)