From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A670371867 for ; Sun, 26 Jul 2026 20:02:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785096158; cv=none; b=WZl1UveTumgd55IMolKTmq0/86IBJiSxf35T5Q1zg7eK88O3Enp9eY+9T+7Q2+kL6Y9Or6eE0O+8JIcnwCShVixabyW7z0Er3V1mkQQKKTa0k50nKQMFEGip84flUDMfMf9Z8hikiYcjziMvUjfC4zDVdhxy05ZveopcZ2VuDPA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785096158; c=relaxed/simple; bh=UmNSSrmFtoiDZpdVH6bkWLgL3f3p7F22sQwqg1gIPXk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=bexzX8EZuO6jszHRXlycUvg5L4IGK0niKODyddryPpXO+bUheQdzSe2t+cud4JrphlxH15iuuhfOI7bEXVTT4MvioQo9518JZd6wrbwHSvfUDl722Sx1mUR79j/Tt/UYn5IHWf9dx+A3kPtw0NEvGgeQlPeFQ851yXlumkVSW3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=gatskyOM; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=XDDTH5e6; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="gatskyOM"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="XDDTH5e6" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id ACD3914004A3; Sun, 26 Jul 2026 16:02:34 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-04.internal (MEProxy); Sun, 26 Jul 2026 16:02:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1785096154; x=1785182554; bh=JyB25d4l5j UqrGvGJxGHT2Aff81rcD4UdJotZyIgOnQ=; b=gatskyOMlynYFizAbNrJGF7Q1S 6xSRMhu9j76klWIe/cc0AY3hQ8FRnRALU3HxAZX/ZfWkw0rdQor+10WdzoHZtuow Os0YtV7L0W6PGd+11mS83683dTUDsvfSDWourUfm5uR4QG6o9Wz4pa5JmdrwZ+mq C6Fnuy8c82qrWxw5EWPkGSsbT2BO/3klMktpIG4LBt+ZYeleQSC5qYsbRKhD+HfU +u93NU1sZWEEEOpHrK1YUpnR5HF3Iv/oMc5ryazYQ3lZIMD1wQgbduD0EuCF2uiL UZ56CuWWubDDEnmEpDs1FmifigMWG1xSkUtIuh+HGFp6nsLsthD1unkGSmxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1785096154; x=1785182554; bh=JyB25d4l5jUqrGvGJxGHT2Aff81rcD4UdJo tZy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-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Jul 2026 16:02:34 -0400 (EDT) From: Junio C Hamano To: Jeff King Cc: git@vger.kernel.org Subject: Re: [PATCH 0/2] diff-lib relative-path cleanups In-Reply-To: <20260726084550.GC2366012@coredump.intra.peff.net> (Jeff King's message of "Sun, 26 Jul 2026 04:45:50 -0400") References: <20260715060523.GA517940@coredump.intra.peff.net> <20260726084550.GC2366012@coredump.intra.peff.net> Date: Sun, 26 Jul 2026 13:02:32 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Jeff King writes: > On Wed, Jul 15, 2026 at 08:17:06AM -0700, Junio C Hamano wrote: > >> Jeff King 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.