git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Merge diff always misses the `\ No newline at end of file` mark
@ 2022-04-30 15:05 Danil Pristupov
  0 siblings, 0 replies; only message in thread
From: Danil Pristupov @ 2022-04-30 15:05 UTC (permalink / raw)
  To: git

For files with conflicts `git diff -- filename` always returns result
without the `No newline at end of file` mark.

I was able to reproduce this with all git versions on all platforms.

Steps to reproduce (macOS, 2.32.0 (Apple Git-132)):

```
git init
echo "line1\nline2" > eol.txt
echo -n "line1\nline2" > noeol.txt
git add .
git commit -m "initial"
git branch br1
echo "line11\nline2" > eol.txt
echo -n "line11\nline2" > noeol.txt
git add .
git commit -m "line1"
git checkout br1
echo "line12\nline2" > eol.txt
echo -n "line12\nline2" > noeol.txt
git add .
git commit -m "line2"
git merge master
git diff -- eol.txt > eol.diff
git diff -- noeol.txt > noeol.diff
```

Expected behavior: `noeol.diff` should have `\ No newline at end of file` mark

Actual behavior: Both `eol.diff` and `noeol.diff` have no `\ No
newline at end of file` mark

This is my first bug report. Please let me know if I'm missing something.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-30 15:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-30 15:05 Merge diff always misses the `\ No newline at end of file` mark Danil Pristupov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).