summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3b8b3c)
raw | patch | inline | side by side (parent: f3b8b3c)
author | Paul Mackerras <paulus@dorrigo.(none)> | |
Mon, 18 Jul 2005 18:29:03 +0000 (14:29 -0400) | ||
committer | Paul Mackerras <paulus@dorrigo.(none)> | |
Mon, 18 Jul 2005 18:29:03 +0000 (14:29 -0400) |
The old style is still available as an option (we still need a
preferences window so we can set/clear it though).
preferences window so we can set/clear it though).
gitk | patch | blob | history |
index 9e52a3579150637dbfeb36d79c392e4a8624532a..1de5ad9316545051fc2f46058055642cf851dfdc 100755 (executable)
--- a/gitk
+++ b/gitk
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
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
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
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]"
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} {
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"
set mainfont {Helvetica 9}
set textfont {Courier 9}
set findmergefiles 0
+set gaudydiff 0
set colors {green red blue magenta darkgrey brown orange}