Revision 06ff64ae3d8c1d446ff61cff78a8faa3a07bfe24 authored by SZEDER Gábor on 16 June 2008, 22:00:02 UTC, committed by Junio C Hamano on 16 June 2008, 22:22:09 UTC
It worked that way since commit 50f575fc (Tweak diff colors,
2006-06-22), but commit c1795bb0 (Unify whitespace checking, 2007-12-13)
changed it.  This patch restores the old behaviour.

Besides Linus' arguments in the log message of 50f575fc, resetting color
before printing newline is also important to keep 'git add --patch'
happy.  If the last line(s) of a file are removed, then that hunk will
end with a colored line.  However, if the newline comes before the color
reset, then the diff output will have an additional line at the end
containing only the reset sequence.  This causes trouble in
git-add--interactive.perl's parse_diff function, because @colored will
have one more element than @diff, and that last element will contain the
color reset.  The elements of these arrays will then be copied to @hunk,
but only as many as the number of elements in @diff.  As a result the
last color reset is lost and all subsequent terminal output will be
printed in color.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 2feaf4e
History
File Mode Size
diff.config_format.subjectprefix_DIFFERENT_PREFIX -rw-r--r-- 53 bytes
diff.diff-tree_--cc_--patch-with-stat_--summary_master -rw-r--r-- 451 bytes
diff.diff-tree_--cc_--patch-with-stat_--summary_side -rw-r--r-- 591 bytes
diff.diff-tree_--cc_--patch-with-stat_master -rw-r--r-- 441 bytes
diff.diff-tree_--cc_--stat_--summary_master -rw-r--r-- 177 bytes
diff.diff-tree_--cc_--stat_--summary_side -rw-r--r-- 222 bytes
diff.diff-tree_--cc_--stat_master -rw-r--r-- 167 bytes
diff.diff-tree_--cc_master -rw-r--r-- 333 bytes
diff.diff-tree_--patch-with-raw_initial -rw-r--r-- 43 bytes
diff.diff-tree_--patch-with-stat_initial -rw-r--r-- 44 bytes
diff.diff-tree_--pretty=oneline_--patch-with-raw_initial -rw-r--r-- 60 bytes
diff.diff-tree_--pretty=oneline_--patch-with-stat_initial -rw-r--r-- 61 bytes
diff.diff-tree_--pretty=oneline_--root_--patch-with-raw_initial -rw-r--r-- 803 bytes
diff.diff-tree_--pretty=oneline_--root_--patch-with-stat_initial -rw-r--r-- 596 bytes
diff.diff-tree_--pretty=oneline_--root_-p_initial -rw-r--r-- 471 bytes
diff.diff-tree_--pretty=oneline_--root_initial -rw-r--r-- 412 bytes
diff.diff-tree_--pretty=oneline_-p_initial -rw-r--r-- 46 bytes
diff.diff-tree_--pretty=oneline_initial -rw-r--r-- 43 bytes
diff.diff-tree_--pretty_--patch-with-raw_initial -rw-r--r-- 52 bytes
diff.diff-tree_--pretty_--patch-with-stat_initial -rw-r--r-- 53 bytes
diff.diff-tree_--pretty_--patch-with-stat_side -rw-r--r-- 657 bytes
diff.diff-tree_--pretty_--root_--patch-with-raw_initial -rw-r--r-- 885 bytes
diff.diff-tree_--pretty_--root_--patch-with-stat_initial -rw-r--r-- 681 bytes
diff.diff-tree_--pretty_--root_--stat_--summary_initial -rw-r--r-- 387 bytes
diff.diff-tree_--pretty_--root_--stat_initial -rw-r--r-- 297 bytes
diff.diff-tree_--pretty_--root_--summary_-r_initial -rw-r--r-- 274 bytes
diff.diff-tree_--pretty_--root_--summary_initial -rw-r--r-- 271 bytes
diff.diff-tree_--pretty_--root_-p_initial -rw-r--r-- 553 bytes
diff.diff-tree_--pretty_--root_initial -rw-r--r-- 494 bytes
diff.diff-tree_--pretty_--stat_--summary_initial -rw-r--r-- 52 bytes
diff.diff-tree_--pretty_--stat_initial -rw-r--r-- 42 bytes
diff.diff-tree_--pretty_--summary_initial -rw-r--r-- 45 bytes
diff.diff-tree_--pretty_-p_initial -rw-r--r-- 38 bytes
diff.diff-tree_--pretty_-p_side -rw-r--r-- 528 bytes
diff.diff-tree_--pretty_initial -rw-r--r-- 35 bytes
diff.diff-tree_--pretty_side -rw-r--r-- 481 bytes
diff.diff-tree_--root_--abbrev_initial -rw-r--r-- 216 bytes
diff.diff-tree_--root_--patch-with-raw_initial -rw-r--r-- 778 bytes
diff.diff-tree_--root_--patch-with-stat_initial -rw-r--r-- 571 bytes
diff.diff-tree_--root_-p_initial -rw-r--r-- 446 bytes
diff.diff-tree_--root_-r_--abbrev=4_initial -rw-r--r-- 207 bytes
diff.diff-tree_--root_-r_--abbrev_initial -rw-r--r-- 223 bytes
diff.diff-tree_--root_-r_initial -rw-r--r-- 394 bytes
diff.diff-tree_--root_initial -rw-r--r-- 387 bytes
diff.diff-tree_-c_--abbrev_master -rw-r--r-- 210 bytes
diff.diff-tree_-c_--stat_--summary_master -rw-r--r-- 175 bytes
diff.diff-tree_-c_--stat_--summary_side -rw-r--r-- 220 bytes
diff.diff-tree_-c_--stat_master -rw-r--r-- 165 bytes
diff.diff-tree_-c_master -rw-r--r-- 381 bytes
diff.diff-tree_-p_-m_master -rw-r--r-- 980 bytes
diff.diff-tree_-p_initial -rw-r--r-- 29 bytes
diff.diff-tree_-p_master -rw-r--r-- 28 bytes
diff.diff-tree_-r_--abbrev=4_initial -rw-r--r-- 40 bytes
diff.diff-tree_-r_--abbrev_initial -rw-r--r-- 38 bytes
diff.diff-tree_-r_initial -rw-r--r-- 29 bytes
diff.diff-tree_initial -rw-r--r-- 26 bytes
diff.diff-tree_master -rw-r--r-- 25 bytes
diff.diff_--abbrev_initial..side -rw-r--r-- 393 bytes
diff.diff_--name-status_dir2_dir -rw-r--r-- 46 bytes
diff.diff_--patch-with-raw_-r_initial..side -rw-r--r-- 542 bytes
diff.diff_--patch-with-raw_initial..side -rw-r--r-- 539 bytes
diff.diff_--patch-with-stat_-r_initial..side -rw-r--r-- 516 bytes
diff.diff_--patch-with-stat_initial..side -rw-r--r-- 513 bytes
diff.diff_--stat_initial..side -rw-r--r-- 144 bytes
diff.diff_-r_--stat_initial..side -rw-r--r-- 147 bytes
diff.diff_-r_initial..side -rw-r--r-- 387 bytes
diff.diff_initial..side -rw-r--r-- 384 bytes
diff.format-patch_--attach_--stdout_initial..master -rw-r--r-- 3.5 KB
diff.format-patch_--attach_--stdout_initial..master^ -rw-r--r-- 2.3 KB
diff.format-patch_--attach_--stdout_initial..side -rw-r--r-- 1.2 KB
diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master -rw-r--r-- 3.5 KB
diff.format-patch_--inline_--stdout_initial..master -rw-r--r-- 3.5 KB
diff.format-patch_--inline_--stdout_initial..master^ -rw-r--r-- 2.3 KB
diff.format-patch_--inline_--stdout_initial..master^^ -rw-r--r-- 1.3 KB
diff.format-patch_--inline_--stdout_initial..side -rw-r--r-- 1.2 KB
diff.format-patch_--stdout_--cover-letter_-n_initial..master^ -rw-r--r-- 1.8 KB
diff.format-patch_--stdout_initial..master -rw-r--r-- 2.0 KB
diff.format-patch_--stdout_initial..master^ -rw-r--r-- 1.3 KB
diff.format-patch_--stdout_initial..side -rw-r--r-- 736 bytes
diff.log_--patch-with-stat_--summary_master_--_dir_ -rw-r--r-- 1.4 KB
diff.log_--patch-with-stat_master -rw-r--r-- 2.0 KB
diff.log_--patch-with-stat_master_--_dir_ -rw-r--r-- 1.4 KB
diff.log_--root_--cc_--patch-with-stat_--summary_master -rw-r--r-- 3.0 KB
diff.log_--root_--patch-with-stat_--summary_master -rw-r--r-- 2.7 KB
diff.log_--root_--patch-with-stat_master -rw-r--r-- 2.5 KB
diff.log_--root_-c_--patch-with-stat_--summary_master -rw-r--r-- 3.0 KB
diff.log_--root_-p_master -rw-r--r-- 2.1 KB
diff.log_--root_master -rw-r--r-- 791 bytes
diff.log_-SF_-p_master -rw-r--r-- 285 bytes
diff.log_-SF_master -rw-r--r-- 159 bytes
diff.log_-p_master -rw-r--r-- 1.7 KB
diff.log_master -rw-r--r-- 784 bytes
diff.show_--patch-with-raw_side -rw-r--r-- 666 bytes
diff.show_--patch-with-stat_--summary_side -rw-r--r-- 679 bytes
diff.show_--patch-with-stat_side -rw-r--r-- 643 bytes
diff.show_--root_initial -rw-r--r-- 536 bytes
diff.show_--stat_--summary_side -rw-r--r-- 307 bytes
diff.show_--stat_side -rw-r--r-- 271 bytes
diff.show_initial -rw-r--r-- 159 bytes
diff.show_master -rw-r--r-- 462 bytes
diff.show_side -rw-r--r-- 511 bytes
diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ -rw-r--r-- 1.1 KB
diff.whatchanged_--patch-with-stat_master -rw-r--r-- 1.7 KB
diff.whatchanged_--patch-with-stat_master_--_dir_ -rw-r--r-- 1.1 KB
diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master -rw-r--r-- 3.0 KB
diff.whatchanged_--root_--patch-with-stat_--summary_master -rw-r--r-- 2.5 KB
diff.whatchanged_--root_--patch-with-stat_master -rw-r--r-- 2.3 KB
diff.whatchanged_--root_-c_--patch-with-stat_--summary_master -rw-r--r-- 3.0 KB
diff.whatchanged_--root_-p_master -rw-r--r-- 1.9 KB
diff.whatchanged_--root_master -rw-r--r-- 1.1 KB
diff.whatchanged_-SF_-p_master -rw-r--r-- 293 bytes
diff.whatchanged_-SF_master -rw-r--r-- 215 bytes
diff.whatchanged_-p_master -rw-r--r-- 1.4 KB
diff.whatchanged_master -rw-r--r-- 842 bytes

back to top