summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Paul Mackerras <paulus@dorrigo.(none)>2005-07-18 14:29:03 -0400
committerLibravatar Paul Mackerras <paulus@dorrigo.(none)>2005-07-18 14:29:03 -0400
commitf06548617ddb79d26108a5293c918efd60774f0d (patch)
tree6339f619c69153c3476360b4a6d98ea898c3d2fe
parentAllow short SHA1 IDs in the SHA1 entry field. (diff)
downloadtgif-f06548617ddb79d26108a5293c918efd60774f0d.tar.xz
Make the diff display less gaudy.
The old style is still available as an option (we still need a preferences window so we can set/clear it though).
-rwxr-xr-xgitk46
1 files changed, 32 insertions, 14 deletions
diff --git a/gitk b/gitk
index 9e52a35791..1de5ad9316 100755
--- a/gitk
+++ b/gitk
@@ -60,7 +60,7 @@ proc getcommitlines {commfd} {
set stuff [read $commfd]
if {$stuff == {}} {
if {![eof $commfd]} return
- # this works around what is apparently a bug in Tcl...
+ # set it blocking so we wait for the process to terminate
fconfigure $commfd -blocking 1
if {![catch {close $commfd} err]} {
after idle finishcommits
@@ -273,7 +273,7 @@ proc makewindow {} {
global findtype findtypemenu findloc findstring fstring geometry
global entries sha1entry sha1string sha1but
global maincursor textcursor
- global rowctxmenu
+ global rowctxmenu gaudydiff
menu .bar
.bar add cascade -label "File" -menu .bar.file
@@ -364,11 +364,17 @@ proc makewindow {} {
pack $ctext -side left -fill both -expand 1
.ctop.cdet add .ctop.cdet.left
- $ctext tag conf filesep -font [concat $textfont bold]
- $ctext tag conf hunksep -back blue -fore white
- $ctext tag conf d0 -back "#ff8080"
- $ctext tag conf d1 -back green
- $ctext tag conf found -back yellow
+ $ctext tag conf filesep -font [concat $textfont bold] -back "#aaaaaa"
+ if {$gaudydiff} {
+ $ctext tag conf hunksep -back blue -fore white
+ $ctext tag conf d0 -back "#ff8080"
+ $ctext tag conf d1 -back green
+ } else {
+ $ctext tag conf hunksep -fore blue
+ $ctext tag conf d0 -fore red
+ $ctext tag conf d1 -fore "#00a000"
+ $ctext tag conf found -back yellow
+ }
frame .ctop.cdet.right
set cflist .ctop.cdet.right.cfiles
@@ -465,8 +471,10 @@ proc savestuff {w} {
if {![winfo viewable .]} return
catch {
set f [open "~/.gitk-new" w]
- puts $f "set mainfont {$mainfont}"
- puts $f "set textfont {$textfont}"
+ puts $f [list set mainfont $mainfont]
+ puts $f [list set textfont $textfont]
+ puts $f [list set findmergefiles $findmergefiles]
+ puts $f [list set gaudydiff $gaudydiff]
puts $f "set geometry(width) [winfo width .ctop]"
puts $f "set geometry(height) [winfo height .ctop]"
puts $f "set geometry(canv1) [expr [winfo width $canv]-2]"
@@ -1787,6 +1795,7 @@ proc getblobdiffline {bdf ids} {
global diffids blobdifffd ctext curdifftag curtagstart
global diffnexthead diffnextnote diffindex difffilestart
global nextupdate diffpending diffpindex diffinhdr
+ global gaudydiff
set n [gets $bdf line]
if {$n < 0} {
@@ -1829,18 +1838,26 @@ proc getblobdiffline {bdf ids} {
set diffinhdr 0
} elseif {[regexp {^@@ -([0-9]+),([0-9]+) \+([0-9]+),([0-9]+) @@(.*)} \
$line match f1l f1c f2l f2c rest]} {
- $ctext insert end "\t" hunksep
- $ctext insert end " $f1l " d0 " $f2l " d1
- $ctext insert end " $rest \n" hunksep
+ if {$gaudydiff} {
+ $ctext insert end "\t" hunksep
+ $ctext insert end " $f1l " d0 " $f2l " d1
+ $ctext insert end " $rest \n" hunksep
+ } else {
+ $ctext insert end "$line\n" hunksep
+ }
set diffinhdr 0
} else {
set x [string range $line 0 0]
if {$x == "-" || $x == "+"} {
set tag [expr {$x == "+"}]
- set line [string range $line 1 end]
+ if {$gaudydiff} {
+ set line [string range $line 1 end]
+ }
$ctext insert end "$line\n" d$tag
} elseif {$x == " "} {
- set line [string range $line 1 end]
+ if {$gaudydiff} {
+ set line [string range $line 1 end]
+ }
$ctext insert end "$line\n"
} elseif {$diffinhdr || $x == "\\"} {
# e.g. "\ No newline at end of file"
@@ -2379,6 +2396,7 @@ set wrcomcmd "git-diff-tree --stdin -p --pretty"
set mainfont {Helvetica 9}
set textfont {Courier 9}
set findmergefiles 0
+set gaudydiff 0
set colors {green red blue magenta darkgrey brown orange}