@@ -60,7 +60,7 @@ proc getcommitlines {commfd} {
60
60
set stuff [read $commfd ]
61
61
if {$stuff == {}} {
62
62
if {![eof $commfd ]} return
63
- # this works around what is apparently a bug in Tcl...
63
+ # set it blocking so we wait for the process to terminate
64
64
fconfigure $commfd -blocking 1
65
65
if {![catch {close $commfd } err]} {
66
66
after idle finishcommits
@@ -273,7 +273,7 @@ proc makewindow {} {
273
273
global findtype findtypemenu findloc findstring fstring geometry
274
274
global entries sha1entry sha1string sha1but
275
275
global maincursor textcursor
276
- global rowctxmenu
276
+ global rowctxmenu gaudydiff
277
277
278
278
menu .bar
279
279
.bar add cascade -label " File" -menu .bar.file
@@ -364,11 +364,17 @@ proc makewindow {} {
364
364
pack $ctext -side left -fill both -expand 1
365
365
.ctop.cdet add .ctop.cdet.left
366
366
367
- $ctext tag conf filesep -font [concat $textfont bold]
368
- $ctext tag conf hunksep -back blue -fore white
369
- $ctext tag conf d0 -back " #ff8080"
370
- $ctext tag conf d1 -back green
371
- $ctext tag conf found -back yellow
367
+ $ctext tag conf filesep -font [concat $textfont bold] -back " #aaaaaa"
368
+ if {$gaudydiff } {
369
+ $ctext tag conf hunksep -back blue -fore white
370
+ $ctext tag conf d0 -back " #ff8080"
371
+ $ctext tag conf d1 -back green
372
+ } else {
373
+ $ctext tag conf hunksep -fore blue
374
+ $ctext tag conf d0 -fore red
375
+ $ctext tag conf d1 -fore " #00a000"
376
+ $ctext tag conf found -back yellow
377
+ }
372
378
373
379
frame .ctop.cdet.right
374
380
set cflist .ctop.cdet.right.cfiles
@@ -465,8 +471,10 @@ proc savestuff {w} {
465
471
if {![winfo viewable .]} return
466
472
catch {
467
473
set f [open " ~/.gitk-new" w]
468
- puts $f " set mainfont {$mainfont }"
469
- puts $f " set textfont {$textfont }"
474
+ puts $f [list set mainfont $mainfont ]
475
+ puts $f [list set textfont $textfont ]
476
+ puts $f [list set findmergefiles $findmergefiles ]
477
+ puts $f [list set gaudydiff $gaudydiff ]
470
478
puts $f " set geometry(width) [ winfo width .ctop] "
471
479
puts $f " set geometry(height) [ winfo height .ctop] "
472
480
puts $f " set geometry(canv1) [ expr [winfo width $canv ] -2]"
@@ -1787,6 +1795,7 @@ proc getblobdiffline {bdf ids} {
1787
1795
global diffids blobdifffd ctext curdifftag curtagstart
1788
1796
global diffnexthead diffnextnote diffindex difffilestart
1789
1797
global nextupdate diffpending diffpindex diffinhdr
1798
+ global gaudydiff
1790
1799
1791
1800
set n [gets $bdf line]
1792
1801
if {$n < 0} {
@@ -1829,18 +1838,26 @@ proc getblobdiffline {bdf ids} {
1829
1838
set diffinhdr 0
1830
1839
} elseif {[regexp {^@@ -([0-9]+),([0-9]+) \+([0-9]+),([0-9]+) @@(.*)} \
1831
1840
$line match f1l f1c f2l f2c rest]} {
1832
- $ctext insert end " \t " hunksep
1833
- $ctext insert end " $f1l " d0 " $f2l " d1
1834
- $ctext insert end " $rest \n " hunksep
1841
+ if {$gaudydiff } {
1842
+ $ctext insert end " \t " hunksep
1843
+ $ctext insert end " $f1l " d0 " $f2l " d1
1844
+ $ctext insert end " $rest \n " hunksep
1845
+ } else {
1846
+ $ctext insert end " $line \n " hunksep
1847
+ }
1835
1848
set diffinhdr 0
1836
1849
} else {
1837
1850
set x [string range $line 0 0]
1838
1851
if {$x == " -" || $x == " +" } {
1839
1852
set tag [expr {$x == " +" }]
1840
- set line [string range $line 1 end]
1853
+ if {$gaudydiff } {
1854
+ set line [string range $line 1 end]
1855
+ }
1841
1856
$ctext insert end " $line \n " d$tag
1842
1857
} elseif {$x == " " } {
1843
- set line [string range $line 1 end]
1858
+ if {$gaudydiff } {
1859
+ set line [string range $line 1 end]
1860
+ }
1844
1861
$ctext insert end " $line \n "
1845
1862
} elseif {$diffinhdr || $x == " \\ " } {
1846
1863
# e.g. "\ No newline at end of file"
@@ -2379,6 +2396,7 @@ set wrcomcmd "git-diff-tree --stdin -p --pretty"
2379
2396
set mainfont {Helvetica 9}
2380
2397
set textfont {Courier 9}
2381
2398
set findmergefiles 0
2399
+ set gaudydiff 0
2382
2400
2383
2401
set colors {green red blue magenta darkgrey brown orange}
2384
2402
0 commit comments