author | Junio C Hamano <gitster@pobox.com> | |
Thu, 22 Sep 2011 17:54:47 +0000 (10:54 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 22 Sep 2011 17:54:47 +0000 (10:54 -0700) | ||
commit | f01cae918feb564da8c7a286b32c7c917599acdd | |
tree | 10766f44cc26f8d4183786515ea4a6236ded411c | tree | snapshot |
parent | 87b50542a08ac6caa083ddc376e674424e37940a | commit | diff |
diff: teach --stat/--numstat to honor -U$num
"git diff -p" piped to external diffstat and "git diff --stat" may see
different patch text (both are valid and describe the same change
correctly) when counting the number of added and deleted lines, arriving
at different results to confuse the users, as --stat/--numstat codepath
always uses the hardcoded -U0 as the context length.
Make --stat/--numstat codepath to honor the context length the same way
as the textual patch codepath does to avoid this problem.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"git diff -p" piped to external diffstat and "git diff --stat" may see
different patch text (both are valid and describe the same change
correctly) when counting the number of added and deleted lines, arriving
at different results to confuse the users, as --stat/--numstat codepath
always uses the hardcoded -U0 as the context length.
Make --stat/--numstat codepath to honor the context length the same way
as the textual patch codepath does to avoid this problem.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | diff | blob | history |