git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC Outreachy] Teach ci/check-whitespace to flag incomplete lines as an error

From
Bello Caleb Olamide <belkid98@gmail.com>
Date
Oct 11, 2025, 14:24 UTC
Message-ID
<aOporVVSRRL/v4Lq@ubuntu>
Hello,

While going through the mailing list for some #leftoverbits, I stumbled on this converation. https://public-inbox.org/git/xmqqikla86id.fsf@gitster.g/.

After studying the check-whitespace script, I observed that the script parses each line of the output of the command `git log --check --pretty=format:"---% h% s" "${baseCommit}"..` and formats the result.

But the output of the git command itself does not flag '\no newline at end of file' as it is shown in git diff, in a case where the files does not contain a newline at the end of the file.

One approach I propose to take is to check the each file changed in each commit and check if it has the \n as the last character.

Please, will this be good for a microproject and also I'll appreciate suggestions for the approach. Thank you.

Bello
Next: Junio C Hamano
Message 1 of 4 in “[RFC Outreachy] Teach ci/check-whitespace to flag incomplete lines as an error”
  1. Bello Caleb OlamideOct 11, 2025
  2. Junio C HamanoOct 11, 2025
  3. Bello OlamideOct 12, 2025
  4. Junio C HamanoOct 13, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.