git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bello Caleb Olamide <belkid98@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, christian.couder@gmail.com,
	usmanakinyemi202@gmail.com
Subject: [RFC Outreachy] Teach ci/check-whitespace to flag incomplete lines as an error
Date: Sat, 11 Oct 2025 14:24:45 +0000	[thread overview]
Message-ID: <aOporVVSRRL/v4Lq@ubuntu> (raw)

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

             reply	other threads:[~2025-10-11 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-11 14:24 Bello Caleb Olamide [this message]
2025-10-11 19:50 ` [RFC Outreachy] Teach ci/check-whitespace to flag incomplete lines as an error Junio C Hamano
2025-10-12 23:41   ` Bello Olamide
2025-10-13 15:41     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aOporVVSRRL/v4Lq@ubuntu \
    --to=belkid98@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=usmanakinyemi202@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).