From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (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 F208122D792 for ; Fri, 3 Jul 2026 11:03:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783076588; cv=none; b=D6CawBVd6+MyxaBaZ9R2QzyOufJNvJdJtSdqy3kJFvkfhPRpeSsoJyQ9SvlOeg1FLzNS1fz4SisXf07HJ56zz+l2guySpDQn+3in9rUguveOVhjKNPNsfDaybaIKa7Jfa1UmJMv+T89nQYKqBl1Aw/UEqM6UtvR8k/n7s5USzWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783076588; c=relaxed/simple; bh=dimNp5TiAKAfMtBCidyI8DmerTc88b9eKkExuia106g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tjdQTs2QvybhDWxNE8sMdA4IEzsW4yqf06ml405bmn1r8gAiqvZY9ZInQv5o+1GBlrAJYPCHKlQYSrXUV3+fy8I2J5v+2306CBoZgjrIYxNhX349NskOBtzb5Qa6PUfVHQRNtyAVNwXiRVfSyQcHR34VxbS9LvQ1Xn+AEdSZWTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=b7ZgvdCQ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=iq3SE4pu; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="b7ZgvdCQ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="iq3SE4pu" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id E7D3A1D000FD; Fri, 3 Jul 2026 07:03:05 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Fri, 03 Jul 2026 07:03:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; 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=fm2; t=1783076585; x=1783162985; bh=9oezOVGhLR AG/HoMRZ1aCegxmB4P1ZKwP5XlLXPjPEo=; b=b7ZgvdCQxpvkyYyfXJ3GkctG/Y o4fO/BRzLOTOyxTwpcR3wflEVPOsHcHMDiHviqKZ13v2tz5PzDde0yVaY1yzwxgf y3xnMsu2sRs0BZrB/YWHOQZ/gZJa4oEetw09BLn5C8BNcMmH4pFP8t5ehlKoomSN SjEh9BJZojsoNEZN4vCPgtUSPoFMXrIuOgaTldsPQrXVM9kW0Wqd34pB0/peXhP9 pCaonfLwoBR+XBfms95TrCfVbcLsfYMaTBlxHvijA08CnWjmTMiNHqYVsHD0CJKA oLzjf/YqPD6V/H8du8Wtj9O6jplVX/3DkmJZqi/JaJn1JK6YbFPkFMI2EE6Q== 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= 1783076585; x=1783162985; bh=9oezOVGhLRAG/Ho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+fU41e5BNmpcLrD8DkrN5FZNlZPw X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jul 2026 07:03:04 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id cd754776 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 3 Jul 2026 11:03:02 +0000 (UTC) Date: Fri, 3 Jul 2026 13:02:59 +0200 From: Patrick Steinhardt To: me@black-desk.cn Cc: git@vger.kernel.org, Kristoffer Haugsbakk , Junio C Hamano , Phillip Wood Subject: Re: [PATCH v6 2/2] config: add "worktree" and "worktree/i" includeIf conditions Message-ID: References: <20260703-includeif-worktree-v6-0-a13893ad9a7f@black-desk.cn> <20260703-includeif-worktree-v6-2-a13893ad9a7f@black-desk.cn> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260703-includeif-worktree-v6-2-a13893ad9a7f@black-desk.cn> On Fri, Jul 03, 2026 at 11:13:18AM +0800, Chen Linxuan via B4 Relay wrote: > diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh > index f3892578e4ff..4e840dfdb35b 100755 > --- a/t/t1305-config-include.sh > +++ b/t/t1305-config-include.sh > @@ -396,4 +396,132 @@ test_expect_success 'onbranch without repository but explicit nonexistent Git di [snip] > +test_expect_success SYMLINKS 'conditional include, worktree resolves symlinks' ' > + mkdir real-wt && > + ln -s real-wt link-wt && > + git init link-wt/repo && > + ( > + cd link-wt/repo && > + # repo->worktree resolves symlinks, so use real path in pattern > + echo "[includeIf \"worktree:**/real-wt/repo\"]path=bar-link" >>.git/config && > + echo "[test]wtlink=2" >.git/bar-link && > + echo 2 >expect && > + git config test.wtlink >actual && > + test_cmp expect actual > + ) > +' Okay, this covers one scenario. But with "gitdir:" we're actually able to use both the symlinked and the real location: test_expect_success SYMLINKS 'conditional include, worktree matching symlink' ' mkdir sym-real && ln -s sym-real sym-link && git init sym-link/repo && ( cd sym-link/repo && link_path="$(pwd)" && real_path="$(test-tool path-utils real_path "$link_path")" && cat >>.git/config <<-EOF && [includeIf "gitdir:$link_path/.git"] path = gitdir-link [includeIf "gitdir:$real_path/.git"] path = gitdir-real [includeIf "worktree:$link_path"] path = worktree-link [includeIf "worktree:$real_path"] path = worktree-real EOF echo "[test]gitdirlink=1" >.git/gitdir-link && echo "[test]gitdirreal=1" >.git/gitdir-real && echo "[test]worktreelink=1" >.git/worktree-link && echo "[test]worktreereal=1" >.git/worktree-real && git config get test.gitdirlink && git config get test.gitdirreal && git config get test.worktreereal && test_must_fail git config test.worktreelink ) ' The last call to git-config(1) fails, which is inconsistent with how resolve the path for "gitdir". Other than that I didn't have anything to add, thanks! Patrick