git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] whitespace: symbolic links usually lack LF at the end

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 6, 2026, 06:31 UTC
Message-ID
<aYWKyOIMPLiDxqnj@pks.im>
In-Reply-To
<xmqqms1nmbog.fsf@gitster.g>
On Thu, Feb 05, 2026 at 07:50:55AM -0800, Junio C Hamano wrote:
Show 12 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > I'd suggest that we only disable this check in case either:
> >
> >   - One side doesn't exist, the other is a symbolic link.
> >
> >   - Both sides are a symbolic link.
> 
> Hmm.  That is indeed a thoguht.  But we do not want to complain in
> text-to-symlink transition that postimage lacks the terminating LF,
> so the above rules may be a good start but will need further
> tweaking, I am afraid.
Ah, right. Only the other way around, when converting from LF to text.
Show 8 quoted lines
> > Another question is whether we support symref targets that end in a
> > newline. I guess the answer is going to be some form of "yes", and in
> > that case we could of course loose some information. But honestly, this
> > is so much of an edge case that I don't really worry about it too much.
> 
> Do we track, apply and diff any symrefs?  I thought that we do not
> touch anything inside .git/ and symrefs live inside .git/refs/
> (except for .git/HEAD)?

Eh, I didn't mean symrefs here, but symbolic links :) Tools like ln(1) seem to strip trailing newlines, but if you try hard enough you'll probably be able to create symlinks that have a target with trailing newline.

Patrick
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “whitespace: symbolic links usually lack LF at the end”
  1. whitespace: symbolic links usually lack LF at the endJunio C Hamano, Feb 4, 2026
  2. Patrick SteinhardtFeb 5, 2026
  3. Junio C HamanoFeb 5, 2026
  4. Patrick SteinhardtFeb 6, 2026
  5. Junio C HamanoFeb 6, 2026
  6. Patrick SteinhardtFeb 6, 2026
  7. whitespace: symbolic links usually lack LF at the endJunio C Hamano, Feb 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.