From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Wilfred Hughes <me@wilfred.me.uk>, git@vger.kernel.org
Subject: Re: [PATCH] diff: handle NULL meta-info when spawning external diff
Date: Tue, 30 Jan 2024 08:29:33 -0800 [thread overview]
Message-ID: <xmqqa5omdbte.fsf@gitster.g> (raw)
In-Reply-To: <20240130060658.GD166761@coredump.intra.peff.net> (Jeff King's message of "Tue, 30 Jan 2024 01:06:58 -0500")
Jeff King <peff@peff.net> writes:
> The current behavior is somewhere in between, though. You get an "other"
> name passed to the external diff, but the metainfo argument makes no
> mention of a rename (it's either blank for an exact rename, or may
> contain an "index" line if there was a content change).
>
> I'm not sure anybody really cares that much either way, though. It's
> external diff, which I suspect hardly anybody uses, and those extra
> fields aren't even documented in the first place.
Oh, we probably should fix the documentation eventually, then.
But I agree that in this case, whatever stops the segfault would be
good enough.
I am surprised to learn that this 8th hidden parameter dates back to
427dcb4b ([PATCH] Diff overhaul, adding half of copy detection.,
2005-05-21), and it is more surprising that even before it happened,
the external diff interface with 7 parameters was already
documented, which happened with 03ea2802 ([PATCH 2/2] core-git
documentation update, 2005-05-08). Before the addition of the copy
detection, the presence of the "other" was how you learned if we saw
a rename (because there was no copy, the only reason "other" is
there was due to a rename). With copy detection added, extra bits
of information needed to be passed and we started passing the
xfrm_msg as well through the interface. At least, by dumping it to
the end-user, an external diff driver could help the end-user tell
if that "other" came from a rename or from a copy, even if it did
not understand it itself.
And of course, after merely 6 weeks since the inception, Git did not
have the "--no-index" mode (we did not even have a unified "git
diff" frontend), so this was never a problem back then.
prev parent reply other threads:[~2024-01-30 16:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-28 20:24 Git segfaults with diff.external and comparing files with different permissions Wilfred Hughes
2024-01-29 1:57 ` [PATCH] diff: handle NULL meta-info when spawning external diff Jeff King
2024-01-29 18:37 ` Junio C Hamano
2024-01-30 6:06 ` Jeff King
2024-01-30 16:29 ` Junio C Hamano [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa5omdbte.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=me@wilfred.me.uk \
--cc=peff@peff.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.