git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git diff shows twice “\ No newline at end of file” - no need for repetition
@ 2025-08-13  7:20 Дилян Палаузов
  2025-08-13 13:11 ` Phillip Wood
  2025-08-13 14:42 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Дилян Палаузов @ 2025-08-13  7:20 UTC (permalink / raw)
  To: git

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 "<nav id=\"TableOfContents\"></nav>"))
-) }}
\ No newline at end of file
+}}
\ No newline at end of file

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-13 14:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13  7:20 git diff shows twice “\ No newline at end of file” - no need for repetition Дилян Палаузов
2025-08-13 13:11 ` Phillip Wood
2025-08-13 14:51   ` Junio C Hamano
2025-08-13 14:42 ` Junio C Hamano

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).