From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (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 6040526E6F3 for ; Mon, 25 May 2026 07:31:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779694289; cv=none; b=VkOo/mjNernXNJRC8H4hfHpEbQe+gX8E551PMeKOCJkBKgZbXPTC1HGomrFdDUxv4q9iTjjtBmEXkLq0a8gn9XU7516Rt1ieG6O7DDDhPmk/CVJSRbff+3bW760Bv2vwUCSpqjnUmnhUyB1RhfNkHrGS/3jYyLXSK0bOSXjcCHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779694289; c=relaxed/simple; bh=sOkEOAWncYTHjPd6AnbFUhX2jrODjBxA1BpG8u3A1QE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=fTchF0tZJ6OjBwRsqgFd1q3Ur6v2S+EReDYZ4zlnL39PCcMf9MFoB9Au070ehEvlJcFGP7IEy0qSoZUtpfLueLvdjyQ0sJ88vb6OnS00nkAzIAKfmRGdWeT/FOQsA5cyDIec/63SO7jySPb5DPcJOL8z/Y20tENjzngJpU3stPw= 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=PkO4ylF4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ePcTvD7x; arc=none smtp.client-ip=103.168.172.150 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="PkO4ylF4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ePcTvD7x" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 04280EC00B3; Mon, 25 May 2026 03:31:25 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-01.internal (MEProxy); Mon, 25 May 2026 03:31:25 -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=fm2; t=1779694284; x=1779780684; bh=QciXOjmk/I wRNatYdTbicCcWJpurrgdF91CE99tVrRo=; b=PkO4ylF4mksdlM7r2oedNyXPtO PVC7pCYJEx6NLS0IsDnq6A8/rBtzGiBwFuYLUJgKg4aRq22n0z9IzWn71njfgwYy AmCncGhCL2SClunfFnIawMBacmwWNrerzkeeoJKvqD15/BRDVpLjKdJXPMaQQ3Aa 5XbHKw7Tw60Z2B9rhrgovYr0rTdzreJdmrYqZx/PHMoh5PmlvpGaBP6XEr695tRL mQfOX1FTV2Geds5t+ouUPBh7826p+4veezug517jp5NWr9jkjqb7YL3VAlRwzxaP 1KS+La/RA5osEPG8fKGR/k9A4UWkNHj8SYAyk0UUxTcsM1SK+C2/XKQE14BQ== 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=fm3; t= 1779694284; x=1779780684; bh=QciXOjmk/IwRNatYdTbicCcWJpurrgdF91C E99tVrRo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feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 May 2026 03:31:23 -0400 (EDT) From: Junio C Hamano To: Chen Linxuan via B4 Relay Cc: git@vger.kernel.org, Kristoffer Haugsbakk , Patrick Steinhardt , Chen Linxuan , Phillip Wood Subject: Re: [PATCH v5 0/2] includeIf: add "worktree" condition for matching working tree path In-Reply-To: <20260525-includeif-worktree-v5-0-1efe525d025a@black-desk.cn> (Chen Linxuan via's message of "Mon, 25 May 2026 11:20:07 +0800") References: <20260525-includeif-worktree-v5-0-1efe525d025a@black-desk.cn> Date: Mon, 25 May 2026 16:31:22 +0900 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 Chen Linxuan via B4 Relay writes: > Changes in v5: > - Fix Windows CI failure: use `**` glob pattern instead of `/` in the > "worktree without repository" tests, since `/` as a path pattern is > Unix-specific and does not match Windows paths. Would it have worked if you used something like "[/\\].path", instead of "/.path", to cover directory delimiters for both systems? I am not asking to make further changes. I am trying to understand what the extent of the problem was. There are tons of [includeIf] that spells path patterns with the assumption that '/' can be used as the directory separator, like these lines taken from : echo "[includeIf \"gitdir:foo/\"]path=bar" >>.git/config && echo "[includeIf \"gitdir:~/foo/\"]path=bar2" >>.git/config && echo "[includeIf \"gitdir:**/foo/**\"]path=bar3" >>.git/config && echo "[includeIf \"gitdir:./foo/.git\"]path=bar4" >>.gitconfig && echo "[includeIf \"gitdir/i:FOO/\"]path=bar5" >>.git/config && echo "[includeIf \"gitdir:foo/\"]path=bar6" >>.git/config && [includeIf "gitdir:**/foo/**/bar/**"] echo "[includeIf \"gitdir:~/foo/\"]path=bar2" >>.git/config && echo "[includeIf \"gitdir:./foo/.git\"]path=bar4" >home/.gitconfig && echo "[includeIf \"gitdir:bar/\"]path=bar7" >>.git/config && echo "[includeIf \"gitdir/i:BAR/\"]path=bar8" >>.git/config && echo "[includeIf \"onbranch:foo-branch\"]path=bar9" >>.git/config && echo "[includeIf \"onbranch:?oo-*/**\"]path=bar10" >>.git/config && echo "[includeIf \"onbranch:foo-dir/\"]path=bar11" >>.git/config && and there is none, as far as I can tell, that uses a backslash as directory separator. Shoudln't the new worktree location code normalize the pathname before doing a pattern matching so that it would allow '/'-separated path pattern to match? FWIW, here is the diff between v4 and v5. t/t1305-config-include.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git c/t/t1305-config-include.sh w/t/t1305-config-include.sh index 07b6fb649c..25f484eec5 100755 --- c/t/t1305-config-include.sh +++ w/t/t1305-config-include.sh @@ -462,6 +462,19 @@ test_expect_success SYMLINKS 'conditional include, worktree resolves symlinks' ' ) ' +test_expect_success !CASE_INSENSITIVE_FS 'conditional include, worktree, case sensitive' ' + git init wt-case && + ( + cd wt-case && + test_commit initial && + wt_path="$(pwd)" && + wt_upper=$(echo "$wt_path" | tr a-z A-Z) && + echo "[includeIf \"worktree:$wt_upper\"]path=case-inc" >>.git/config && + echo "[test]wtcase=1" >.git/case-inc && + test_must_fail git config test.wtcase + ) +' + test_expect_success 'conditional include, worktree, icase' ' git init wt-icase && ( @@ -495,7 +508,7 @@ test_expect_success 'conditional include, worktree does not match in early confi test_expect_success 'conditional include, worktree without repository' ' test_when_finished "rm -f .gitconfig config.inc" && - git config set -f .gitconfig "includeIf.worktree:/.path" config.inc && + git config set -f .gitconfig "includeIf.worktree:**.path" config.inc && git config set -f config.inc foo.bar baz && git config get foo.bar && test_must_fail nongit git config get foo.bar @@ -503,7 +516,7 @@ test_expect_success 'conditional include, worktree without repository' ' test_expect_success 'conditional include, worktree without repository but explicit nonexistent Git directory' ' test_when_finished "rm -f .gitconfig config.inc" && - git config set -f .gitconfig "includeIf.worktree:/.path" config.inc && + git config set -f .gitconfig "includeIf.worktree:**.path" config.inc && git config set -f config.inc foo.bar baz && git config get foo.bar && test_must_fail nongit git --git-dir=nonexistent config get foo.bar