From: Junio C Hamano <gitster@pobox.com>
To: Ignacio Taranto <ignacio.taranto@eclypsium.com>
Cc: git@vger.kernel.org
Subject: Re: About git reporting missing newline for symlinks
Date: Wed, 12 Oct 2022 14:31:18 -0700 [thread overview]
Message-ID: <xmqq7d14k9uh.fsf@gitster.g> (raw)
In-Reply-To: <CAAHd=zcrU3VJro1R3xDj3hmqGXZHUA6rHuDFxwhF5aewNvA8xQ@mail.gmail.com> (Ignacio Taranto's message of "Wed, 12 Oct 2022 18:17:04 -0300")
Ignacio Taranto <ignacio.taranto@eclypsium.com> writes:
> So, both git diff and git show display "\ No newline at end of file"
> for symlinks.
>
> I think this is related to how Git renders diffs, IMO it shouldn't
> display a warning about newlines for symlinks.
>
> Am I making any sense here?
Yes, but not really.
It is not "warning" at all. The users want to know when compared
contents do or do not end with an incomplete line at the end, and
the "\ No newline" is the diff's way to give that single bit of
information to us.
And the contents of a symbolic link typically is a single incomplete
line, so it is expected to see "\ No newline" when comparing them.
This is important as "git diff | git -C ../some/where/else apply"
should be able to recreate the change in the current repository
(which may have change to or addition of a symbolic link) in the
other repository, and "git apply" on the receiving end must be able
to tell that the symbolic link it needs to create in the other
repository must not have an extra LF at the end.
next prev parent reply other threads:[~2022-10-12 21:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 21:17 About git reporting missing newline for symlinks Ignacio Taranto
2022-10-12 21:31 ` Junio C Hamano [this message]
2022-10-12 21:42 ` Ignacio Taranto
2022-10-13 13:11 ` Ævar Arnfjörð Bjarmason
2022-10-13 16:02 ` Junio C Hamano
2022-10-13 16:57 ` Ævar Arnfjörð Bjarmason
2022-10-13 18:50 ` Junio C Hamano
2022-10-13 19:33 ` Ævar Arnfjörð Bjarmason
2022-10-13 20:06 ` Junio C Hamano
2022-10-13 20:34 ` Philip Oakley
2022-10-13 22:01 ` Erik Cervin Edin
2022-10-12 21:32 ` brian m. carlson
2022-10-12 21:34 ` Junio C Hamano
2022-10-12 21:42 ` brian m. carlson
2022-10-13 2:17 ` Taylor Blau
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=xmqq7d14k9uh.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ignacio.taranto@eclypsium.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).