From: Junio C Hamano Date: Mon, 24 Nov 2025 19:48:47 +0000 (-0800) Subject: Merge branch 'jc/whitespace-incomplete-line' into next X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9682c7f652567eaa256c0a63e922a1260d7186cd;p=thirdparty%2Fgit.git Merge branch 'jc/whitespace-incomplete-line' into next Both "git apply" and "git diff" learn a new whitespace error class, "incomplete-line". * jc/whitespace-incomplete-line: attr: enable incomplete-line whitespace error for this project diff: highlight and error out on incomplete lines apply: check and fix incomplete lines whitespace: allocate a few more bits and define WS_INCOMPLETE_LINE apply: revamp the parsing of incomplete lines diff: update the way rewrite diff handles incomplete lines diff: call emit_callback ecbdata everywhere diff: refactor output of incomplete line diff: keep track of the type of the last line seen diff: correct suppress_blank_empty hack diff: emit_line_ws_markup() if/else style fix whitespace: correct bit assignment comments --- 9682c7f652567eaa256c0a63e922a1260d7186cd diff --cc .gitattributes index 6e66623b12,a8e2950a73..700743c3f5 --- a/.gitattributes +++ b/.gitattributes @@@ -1,6 -1,6 +1,6 @@@ -* whitespace=!indent,trail,space +* whitespace=trail,space - *.[ch] whitespace=indent,trail,space diff=cpp - *.sh whitespace=indent,trail,space text eol=lf + *.[ch] whitespace=indent,trail,space,incomplete diff=cpp + *.sh whitespace=indent,trail,space,incomplete text eol=lf *.perl text eol=lf diff=perl *.pl text eof=lf diff=perl *.pm text eol=lf diff=perl diff --cc diff.c index 915317025f,7b7cd50dc2..f66dd7ff6b --- a/diff.c +++ b/diff.c @@@ -1351,17 -1358,7 +1358,10 @@@ static void emit_diff_symbol_from_struc int len = eds->len; unsigned flags = eds->flags; + if (!o->file) + return; + switch (s) { - case DIFF_SYMBOL_NO_LF_EOF: - context = diff_get_color_opt(o, DIFF_CONTEXT); - reset = diff_get_color_opt(o, DIFF_RESET); - putc('\n', o->file); - emit_line_0(o, context, NULL, 0, reset, '\\', - nneof, strlen(nneof)); - break; case DIFF_SYMBOL_SUBMODULE_HEADER: case DIFF_SYMBOL_SUBMODULE_ERROR: case DIFF_SYMBOL_SUBMODULE_PIPETHROUGH: