public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] whitespace: symbolic links usually lack LF at the end
Date: Fri, 6 Feb 2026 17:58:01 +0100	[thread overview]
Message-ID: <aYYdmUd4uqgK2Z1_@pks.im> (raw)
In-Reply-To: <xmqqv7g9hm9l.fsf@gitster.g>

On Fri, Feb 06, 2026 at 08:25:42AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > On Thu, Feb 05, 2026 at 07:50:55AM -0800, Junio C Hamano wrote:
> >> 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.
> 
> I've decided to use the "disable only when the side that appears
> postimage (taking --reverse option into account) is a symbolic link"
> rule.
> 
> Strictly speaking, "diff" (but not "apply") has wsErrorHighlight
> feature where it can be configured to complain about whitespace
> glitches in both pre- and postimage, so it is technically not
> sufficient, but it is not worth supporting diff.wsErrorHighlight
> that is set to anything but "new" (or "default" which is its
> synonym).

Sounds sensible.

> > 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.
> 
> Yes, as you can create a file whose name contains a newline, a name
> that ends in a newline is a valid filename that "ln -s" may want to
> support.  I am reasonably sure that we do not want to flag such a
> symbolic link as whitespace damaged.

Yeah, we certainly don't want that. The remark was rather about a reader
not being able to discern those two cases (does or does not end in a
newline) anymore. Or would they?

Patrick

  reply	other threads:[~2026-02-06 16:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 21:23 [PATCH] whitespace: symbolic links usually lack LF at the end Junio C Hamano
2026-02-05 12:21 ` Patrick Steinhardt
2026-02-05 15:50   ` Junio C Hamano
2026-02-06  6:31     ` Patrick Steinhardt
2026-02-06 16:25       ` Junio C Hamano
2026-02-06 16:58         ` Patrick Steinhardt [this message]
2026-02-06 16:25 ` [PATCH v2] " Junio C Hamano

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=aYYdmUd4uqgK2Z1_@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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