Re: About git reporting missing newline for symlinks
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Oct 13, 2022, 19:33 UTC
- Message-ID
- <221013.8635brldj4.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <xmqqtu47fti9.fsf@gitster.g>
On Thu, Oct 13 2022, Junio C Hamano wrote:
Show 18 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: > >>>> \ The filename pointed to by the symlink does not end in a newline >>> >>> While I do not think it would break anybody, I doubt it would give >>> us much value. One line above that output is a line that any user, >>> who is vaguely familiar with the contents being compared, can >>> recognize as giving a pathname, the contents of the symbolic link. >> >> Clearly it confused the initial reporter upthread :) > > But to such a user, I highly suspect that the rephased message above > still looks like a warning, and will result in the same reaction. > > IOW, you want to explain why "does not end in a newline" is worth > expressing in the output. Saying "does not end in a newline" alone > would tell the user what they already know (i.e. the symlink stores > the target filename without an extra LF at the end).
Yes, but isn't the point of the report/confusion that we're inserting what looks like the warning you get when you forget a \n at the end of a source file, so a user might wonder why they're seeing it at all.
Whereas what we're *really* doing there is not really about that at all, but just inserting a bit of magic so that the diff format & its consumers grok that this line we're inserting there isn't supposed to have a \n, as we're working with a filename.
Maybe e.g.: diff --git a/RelNotes b/RelNotes index d505db645be..758368388a4 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/2.38.0.txt \ No newline at end of file +Documentation/RelNotes/2.39.0.txt \ No newline at end of file
Would, for those users, be less confusing as:
diff --git a/RelNotes b/RelNotes index d505db645be..758368388a4 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/2.38.0.txt \ The symlink above has no trailing NL in its filename +Documentation/RelNotes/2.39.0.txt \ The symlink above has no trailing NL in its filename
*dunno* :)