From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/2] diff-lib relative-path cleanups
Date: Sun, 26 Jul 2026 13:02:32 -0700 [thread overview]
Message-ID: <xmqqjyqhv7s7.fsf@gitster.g> (raw)
In-Reply-To: <20260726084550.GC2366012@coredump.intra.peff.net> (Jeff King's message of "Sun, 26 Jul 2026 04:45:50 -0400")
Jeff King <peff@peff.net> writes:
> On Wed, Jul 15, 2026 at 08:17:06AM -0700, Junio C Hamano wrote:
>
>> Jeff King <peff@peff.net> writes:
>>
>> > A diff using --relative ignores entries outside the current directory.
>> > This results in a segfault when we try to process an unmerged entry
>> > that's outside of our prefix, since we end up with a NULL diff_filepair
>> > and use it without checking that it's valid.
>> > ...
>> > +cc Junio, as you may have some wisdom on that further exploration.
>>
>> Will take a look at the history myself, but I would probably not
>> have much wisdom on a change from 2011. I often do not even
>> remember what I ate for breakfast yesterday ;-).
>
> I have the same problem. ;)
>
> Looks like you reviewed the patch in question already. Here's what I
> uncovered by digging into the history. I don't think it should have any
> functional difference (and even the "avoid unnecessary work" in patch 2
> is probably not very much work in practice), but it might be worth
> doing.
>
> This would go on top (even though patch 2 makes the original fix here
> unnecessary, I'd rather have both in place).
>
> [1/2]: diff-lib: drop stale comment about advancing o->pos
> [2/2]: diff-lib: skip paths outside prefix in oneway_diff()
Both patches look good to me. Let's combine them with the original
fix into a three-patch series and merge them into 'next'.
Thanks.
next prev parent reply other threads:[~2026-07-26 20:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 6:05 [PATCH] diff: ignore unmerged paths outside prefix with --relative --cached Jeff King
2026-07-15 15:17 ` Junio C Hamano
2026-07-26 8:45 ` [PATCH 0/2] diff-lib relative-path cleanups Jeff King
2026-07-26 8:46 ` [PATCH 1/2] diff-lib: drop stale comment about advancing o->pos Jeff King
2026-07-26 8:47 ` [PATCH 2/2] diff-lib: skip paths outside prefix in oneway_diff() Jeff King
2026-07-26 20:02 ` Junio C Hamano [this message]
2026-07-24 21:30 ` [PATCH] diff: ignore unmerged paths outside prefix with --relative --cached 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=xmqqjyqhv7s7.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--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.