With Git 2.25 (Q1 2020), three+ years later, the "diff" machinery learned not to lose added/removed blank lines in the context when --ignore-blank-lines
and --function-context
are used at the same time.
So your intermediate 4 empty lines won't show up.
But in the context of functions, they might.
See commit 0bb313a (05 Dec 2019) by René Scharfe (rscharfe
).
(Merged by Junio C Hamano -- gitster
-- in commit f0070a7, 16 Dec 2019)
xdiff
: unignore changes in function context
Signed-off-by: René Scharfe
Changes involving only blank lines are hidden with --ignore-blank-lines
, unless they appear in the context lines of other changes.
This is handled by xdl_get_hunk()
for context added by --inter-hunk-context
, -u
and -U
.
Function context for -W
and --function-context
added by xdl_emit_diff()
doesn't pay attention to such ignored changes; it relies fully on xdl_get_hunk()
and shows just the post-image of ignored changes appearing in function context.
That's inconsistent and confusing.
Improve the result of using --ignore-blank-lines
and --function-context
together by fully showing ignored changes if they happen to fall within function context.