@matheusbsbs / matheus-bagliano / commits / 88b21c2a40
Fork 0

git-gui: Fix use of hunk tag for non-hunk content.

The hunk tag d_@ lost its blue forground color in "apply color information from git diff output" (2010-10-22, 8f85599). But this tag was also used for non-hunk content like untracked file mime types or git submodules. Introduce a new tag for this type of content which has the blue forground again. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Bert Wesarg committed Dec 6, 2010 at 22:01 UTC 88b21c2a407833a66f9aeb650f5b96c672691ecf
2 files changed +9 -7
git-gui.sh
+2
@@ -3331,6 +3331,8 @@ foreach {n c} {0 black 1 red4 2 green4 3 yellow4 4 blue4 5 magenta4 6 cyan4 7 gr
3331 }
3332 $ui_diff tag configure clr1 -font font_diffbold
3333
3334 +$ui_diff tag conf d_info -foreground blue -font font_diffbold
3335 +
3336 $ui_diff tag conf d_cr -elide true
3337 $ui_diff tag conf d_@ -font font_diffbold
3338 $ui_diff tag conf d_+ -foreground {#00a000}
lib/diff.tcl
+7 -7
@@ -208,32 +208,32 @@ proc show_other_diff {path w m cont_info} {
208 $ui_diff insert end [append \
209 "* " \
210 [mc "Git Repository (subproject)"] \
211 - "\n"] d_@
211 + "\n"] d_info
212 } elseif {![catch {set type [exec file $path]}]} {
213 set n [string length $path]
214 if {[string equal -length $n $path $type]} {
215 set type [string range $type $n end]
216 regsub {^:?\s*} $type {} type
217 }
218 - $ui_diff insert end "* $type\n" d_@
218 + $ui_diff insert end "* $type\n" d_info
219 }
220 if {[string first "\0" $content] != -1} {
221 $ui_diff insert end \
222 [mc "* Binary file (not showing content)."] \
223 - d_@
223 + d_info
224 } else {
225 if {$sz > $max_sz} {
226 $ui_diff insert end [mc \
227 "* Untracked file is %d bytes.
228 * Showing only first %d bytes.
229 -" $sz $max_sz] d_@
229 +" $sz $max_sz] d_info
230 }
231 $ui_diff insert end $content
232 if {$sz > $max_sz} {
233 $ui_diff insert end [mc "
234 * Untracked file clipped here by %s.
235 * To see the entire file, use an external editor.
236 -" [appname]] d_@
236 +" [appname]] d_info
237 }
238 }
239 $ui_diff conf -state disabled
@@ -442,10 +442,10 @@ proc read_diff {fd conflict_size cont_info} {
442 } elseif {$is_submodule_diff} {
443 if {$line == ""} continue
444 if {[regexp {^Submodule } $line]} {
445 - set tags d_@
445 + set tags d_info
446 } elseif {[regexp {^\* } $line]} {
447 set line [string replace $line 0 1 {Submodule }]
448 - set tags d_@
448 + set tags d_info
449 } else {
450 set op [string range $line 0 2]
451 switch -- $op {