Subject: Re: [PATCH v4 00/12] Incomplete lines

From: Junio C Hamano <[email-masked]>
Date: Sat, 22 Nov 2025 18:35:17 -0800

Junio C Hamano <[email-masked]> writes:

> Phillip Wood <[email-masked]> writes:
>
>> On 12/11/2025 22:02, Junio C Hamano wrote:
>>> Changes in v4:
>>> 
>>>   - The preliminary clean-up for "git diff" in [04/12] no longer
>>>     "corrects" the code that updates the line number upon seeing
>>>     "\ No newline" marker, and leaves it for later series to clean
>>>     it up as #leftoverbits.
>>
>> I agree it makes sense to leave the existing increment alone as it's not 
>> really related to this series.
>>>   - Our house rule updates in [12/12] now forbids the documentation
>>>     sources *.adoc to end in an incomplete line.
>>> 12:  068229790d ! 12:  cb86d9b45f attr: enable incomplete-line whitespace error for this project
>>>      +-/Documentation/**/*.adoc text eol=lf
>>>      ++/Documentation/**/*.adoc text eol=lf whitespace=!indent,trail,space,incomplete
>>
>> Should that be "-indent" c.f. 358e94dc705 (.gitattributes: remove 
>> misspelled no-op whitespace attribute, 2025-11-11)
>
> Oops.  Thanks for spotting.

This has been locally corrected.  We saw no other comments on this
iteration, and hopefully it is not due to lack of interest.  Let me
mark the topic for 'next' and merge it down.

----- >8 -----
Subject: [PATCH v3bis 12/12] attr: enable incomplete-line whitespace error for this project

Now "git diff --check" and "git apply --whitespace=warn/fix" learned
incomplete line is a whitespace error, enable them for this project
to prevent patches to add new incomplete lines to our source to both
code and documentation files.

Signed-off-by: Junio C Hamano <[email-masked]>
---
 .gitattributes | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.gitattributes b/.gitattributes
index 32583149c2..a8e2950a73 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,13 +1,13 @@
 * whitespace=!indent,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
 *.py text eol=lf diff=python
 *.bat text eol=crlf
 CODE_OF_CONDUCT.md -whitespace
-/Documentation/**/*.adoc text eol=lf
+/Documentation/**/*.adoc text eol=lf whitespace=trail,space,incomplete
 /command-list.txt text eol=lf
 /GIT-VERSION-GEN text eol=lf
 /mergetools/* text eol=lf
-- 
2.52.0-168-g07aa2ddc22