]> git.feebdaed.xyz Git - 0xmirror/git.git/commitdiff
Merge branch 'jc/whitespace-incomplete-line'
authorJunio C Hamano <gitster@pobox.com>
Mon, 1 Dec 2025 02:31:40 +0000 (18:31 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Dec 2025 02:31:40 +0000 (18:31 -0800)
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

1  2 
.gitattributes
Documentation/config/core.adoc
diff.c
diff.h

diff --cc .gitattributes
index 6e66623b12619860aac261f76b98bdd9e95f6e60,a8e2950a7356778b2a43f4da88dd33fbbd73a37d..700743c3f5ef9909ab6a8cce83c26a0a68fbac3f
@@@ -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
Simple merge
diff --cc diff.c
index 915317025f25e5b904d89875b3c9fb78d1b6b546,7b7cd50dc24351312ff186b10b5fbe635fab252e..f66dd7ff6b9610a5fa32cc6a67c5b0955f857b78
--- 1/diff.c
--- 2/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:
diff --cc diff.h
Simple merge