From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Danil Pristupov <danil@danil.cz>
Cc: git@vger.kernel.org
Subject: Re: Diff for unmerged files always misses the `\ No newline at end of file` mark
Date: Sat, 25 Jun 2022 11:49:46 +0000 [thread overview]
Message-ID: <Yrb2Wv92eLmXY6NV@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <CAKdzDnn7KkRpXta1LiHcDPCztPcPRTFv8zTW_v+GpBAuSTW6yg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]
On 2022-06-23 at 15:39:07, Danil Pristupov wrote:
> Some time ago I reported a bug there, but got no response. I hope it's
> OK if I post it again.
>
> Diff for unmerged files always misses 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
> ```
Thanks for the report. I think this is indeed a bug, but maybe someone
more familiar with things than I am can confirm.
From a preliminary examination, it looks like the --cc and regular modes
render diffs completely differently, and code similar to what's at the
end of emit_rewrite_lines belongs at the end of dump_sline as well.
--
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
prev parent reply other threads:[~2022-06-25 12:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-23 15:39 Diff for unmerged files always misses the `\ No newline at end of file` mark Danil Pristupov
2022-06-25 11:49 ` brian m. carlson [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yrb2Wv92eLmXY6NV@tapette.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=danil@danil.cz \
--cc=git@vger.kernel.org \
/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.
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).