From: Дилян Палаузов Date: Wed, 13 Aug 2025 07:20:13 GMT Subject: git diff shows twice “\ No newline at end of file” - no need for repetition Message-ID: <1b0d634286da16f32cd9faf541ee28c811d6c83f.camel@aegee.org> Hello, when a file, which does not end in a new line, is modified, git diff shows twice the text “\ No newline at end of file”. As this piece of the file is not modified, I think git diff should print it once. In the example below the first “\ No newline at end of file” should be skipped. I am using git 2.50.0. As a matter of fact github also shows this information twice - https://github.com/alex-shpak/hugo-book/pull/755/files - which I find is bad. Greetings Дилян $ git diff diff --git a/layouts/_partials/docs/toc-show.html b/layouts/_partials/docs/toc-show.html index 21122a1..c243ae5 100644 --- a/layouts/_partials/docs/toc-show.html +++ b/layouts/_partials/docs/toc-show.html @@ -2,4 +2,4 @@ and (default .Site.Params.BookToC .Params.BookToC) (not (eq .TableOfContents "")) -) }} \ No newline at end of file +}} \ No newline at end of file