From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.152 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795892496; b=rLhmZrkgNz1JzH+QeBbJ1OmEfvX2ByK6YctJathofKusJiGHiHO6UF+J8aj3OZ9z1EhB f9tsdWWrWbbaPWL6J3pmqUbLKgBgFkid6hUicM4k+kJNxulxV4/iLsdruyoC91qKzy1w/ RfNVCvQz/yXDe0U+CS2Lh4w3TCLzeZ5BoDjMaERLEP6cUvAz1oWjl7d5shA5aQ8aUUrA8 LU8R/LHbTViMBth8mUx+wv33VnaGivTsXMPOJDmn37VaCZAr9Mu+4n1EvJAJJ1zy5MrXK dnfbg3P8/P/gegBLE/hNBxiBmlATgQW5cBYsVy5rkrA96b88BI9K2cawrkKNUJ/E2xA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795892496; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: User-Agent:MIME-Version:Content-Type; bh=o9hzC363cf+2MfxhcQOyAS8+Dlob6PBqhl7X8aeV1Jc=; b=p8z9DlYtNweNiChLq3Hhl5OXRbIKWEXzeNPdzrgzM8weF3fmceaTfEpJUXLhiwXUeEVV 0w9KX7XpHg56nSGGv87Se1OmqMtWps/TCyZygwfB9/cH20rnw8Mq+witZvxq73ga7DuNc TsXbXTM4taG1Bw8TON3POIWOMn/T0Igts70C0WewpVxX0ixHaDmuTiuqad/y8/R8gMctR beTfJL73k3DlznXQtxy0UCriVAusclmrKMkM5Fszcl0r300S3uMXsAuiHeGUvWi9+86mK F9ZvVc2kGcvelKXAg8TggCkcFZ3KZMEZ+ayc0YtmtD+OFweXQyoVhzFqAaOHNvtV6HA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=JLHFwgyC; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=DgHI1cvm; arc=none smtp.remote-ip=103.168.172.152 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3950F606A31C for ; Sat, 28 Nov 2026 19:01:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3950F606A31C 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, unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=JLHFwgyC; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=DgHI1cvm Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5131D14001DC for ; Sat, 28 Nov 2026 14:01:34 -0500 (EST) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-01.internal (MEProxy); Sat, 28 Nov 2026 14:01:34 -0500 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=1795892494; x=1795978894; bh=o9hzC363cf +2MfxhcQOyAS8+Dlob6PBqhl7X8aeV1Jc=; b=JLHFwgyCpV6lJaxK6DQGQlC1Bs sy0UZf0EwMszTvKZgy8K1AlesxJga/5pt5VoeHmDEilquzIM8uSnxC4IFCTl1E44 yZ+43bYUdVrMrBS98Sw41LtKf12DnGuxKIe6excTp2464zdJzKB1CqgchncXdGkM vyOoIsizVd0yDyYIlxpSR5qQyxajqBjSAscG4hIA7UoO14ft8v/AjkKQcAHpg4Tb 5yr2GykrEO7eGwAkl7Ll9TU5BAqFv/cB3lH6FX4ozDQNtKThpDLhj7o7/GvY3+i1 SZPKQaQshopHwV3fQk8TkTPd4DyfQ7cM61dtHKemFGmZ1hUeH+Gmm8g73uyA== 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= 1795892494; x=1795978894; bh=o9hzC363cf+2MfxhcQOyAS8+Dlob6PBqhl7 X8aeV1Jc=; b=DgHI1cvmo2V7Lld7kTBLHW8C5irD49GgpGwMlQrlfqk/3+jsTnu 8LE8fy+28jw3VwQp+nu7i5AeSm/HZulFc9CajRKdx9HE1VjEi/Y+J7LEoKAZ4BRQ /maO+i1RXRjzfkUwmpZn8w7dqYzrjqCybDevzbw9lFudRM1yrLNHYrsIw4mCSPsX FEagCL2eOpdsCSi6m42Rur90i8L2LCGH5Or4j69KBWVVVoPZ4Pi9gwN9KL1RLYft 9AS3oy9CSTLSMhiOYQxaET6fUp+WToVYBlObsm72vroKPrg+/jwsFGPMuQtQRWg8 515sdNR/qUPaHsm6fdY647umCl7SvXWe70w== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pobox.com a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1795892494; d=pobox.com; mf=PGdpdHN0ZXJAcG9ib3guY29tPg==; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm2:rsa-sha256:Q82Zb96gXat75BvhtuFSZ/WwcHAkz0XOj89+0vYVjm6xfXJ JD5Qlo9q66mqK87pOZF99yNI2c/pinQou42NcmmtqJIasF6gRtbN4syTZAHb7ebC uGpuEMEYp5KVUcFp9ld0VxWCllLcXpNu1Yj5Q26vPLj6OB2RQynzl1YJ/pgNbL2l R1fbd6Cxj/BHj5NDTDsY9uyzb4Vzq4lA4cPqqP/hhWNgPmM7mPL5mvpE4nvXhCmu SELS+dO8gaO7kQFuOmkpP+LbkSvPafPuzCaPQUDLA8rLOjPrxURKc9i0D3ju1Zls udbVQ68FklwclSXH91k9talD1ldXPUWHK43US7A==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,references,subject,to,user-agent; Message-Instance: m=1; h=sha256:f47ejjy88VJEDK8I0EpSZAjrWChg7eCPrC+sETEOQkg=:CiT17r/Zovx0BDIg836LxnRt/bg7s/EmyztWTwHYo0w=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEh27TQnNPr6K/5Z8PHP2fV8NUDL79uQLmiE1qxBXXatZ6MMJnbJpUC61dv7amNaH GszHDCZVQLmwBGUDuCSsMR4Jauy4m6PueFW/s8usZN7SCjSyU4jclhWYpGeezZnB/1Ra2T lJ/ntVKk2VtQI7nh2sTD5bqdlOCFO2fWsADj7TaDLM4d2Uw4qLzsHyZn+OtFK/DRW7ZhiU 4+expJt3YUArCUlXR1VAnF15hLbohlzt/hF2guh+egv5TrrFWLnTQtTbu3z8ou1pHs0bKo +lq3JAts1xLoqs+7fiJGRBHc7g3salAYb8+307Hnr/6K9qP1fSIRSMc96kD+B4VrAn7rrs 5soMtTuOZE8nk1QWkC2/zmKnwe1yQ8S1y9kks7Dm+zSDrAnVCaf7ewMAVNwIkcmlX98tRD nZUuy/Pv3TfOIqRC6VnetI8PNDsKY7uK9C9bVC/E7rnpSP1SdmNeUyVGdSvC5hA5ypJNvs C21p0LTdYofrfZJrzvHblVXrHopGm2kcT72kLQfOyvTtd+EzXPSjexEpGcWs17tiX/nbKY FDOSOQB4JhfAXCmFRZE/hpnWICyZXxUEdax73ZNHUrgTD9WEEFfVzgF12SNE5x5vpe9FaH T7ZeEjP9JgeDRjS8NLvLzdwaERK4lQijdqAf+vMM6+4oK/RLjaFR68cgPokw X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Nov 2026 14:01:33 -0500 (EST) From: Junio C Hamano To: git@vger.kernel.org Cc: "Matt Hunter" , "Windl, Ulrich" Subject: [PATCH v3] gitignore: rewrite wildcard description In-Reply-To: (Junio C. Hamano's message of "Tue, 03 Nov 2026 14:40:32 -0800") References: <07b3498d83424cac87221724b371839a@ukr.de> Date: Sat, 28 Nov 2026 11:01:32 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain The documentation for '.gitignore' makes reference to fnmatch(3) and FNM_PATHNAME to describe how an asterisk "*" and a question mark "?" behave. Even though it spells out that these wildcard characters do not match a slash, it does not say if an asterisk matches an empty string (it does). Rewrite the section so that the readers would get a more complete picture without requiring them to know what fnmatch(3) and glob(7) say. Signed-off-by: Junio C Hamano --- Changes since v2 are - grammofix in log message, i.e., "what fnmatch(3) and glob(7) say" (not "says"). - we forgot a few rules around bracketed character classes that we relied on our reference to fnmatch(3) with FNM_PATHNAME to cover, which we now need to supply ourselves. - [bracketed list of characters] does not match a slash '/', even if a slash or a range that includes a slash like ".-0" appears inside brackets. - The first character in [bracket] can be "^" or "!" to negate the meaning of a match. Documentation/gitignore.adoc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc index 7979e50f18..de010aa5db 100644 --- a/Documentation/gitignore.adoc +++ b/Documentation/gitignore.adoc @@ -110,11 +110,19 @@ PATTERN FORMAT and `a/frotz` that is a directory (all paths are relative from the `.gitignore` file). - - An asterisk "`*`" matches anything except a slash. - The character "`?`" matches any one character except "`/`". - The range notation, e.g. `[a-zA-Z]`, can be used to match - one of the characters in a range. See fnmatch(3) and the - FNM_PATHNAME flag for a more detailed description. + - An asterisk "`*`" matches any string (including the empty string), + and a question mark "`?`" matches any single character, but these + wildcard characters do not match a slash "`/`". + + - A pair of brackets that enclose characters matches any single + character from the listed characters, other than a slash "`/`". A + range notation inside them, e.g., "`[a-zA-Z]`", behaves as if all + the characters in the range were listed there instead, and a + leading "`!`" or "`^`" negates the match (still excluding "`/`"). + Note that even a range that apparently includes a slash, like + "`[.-0]`" or "`[/]`", does not match a slash "`/`". Wildcard + characters "`*`" and "`?`" lose their special meaning inside a pair + of brackets, e.g., "`[*]`" matches an asterisk and nothing else. - A backslash ("`\`") can be used to escape any character. E.g., "`\*`" matches a literal asterisk (and "`\a`" matches "`a`", even though Interdiff against v1: diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc index 87f37c2b0c..de010aa5db 100644 --- a/Documentation/gitignore.adoc +++ b/Documentation/gitignore.adoc @@ -114,12 +114,15 @@ PATTERN FORMAT and a question mark "`?`" matches any single character, but these wildcard characters do not match a slash "`/`". - - A pair of brackets that enclose characters match one of the listed - characters, and a range notation inside them, e.g., "`[a-zA-Z]`", - would behave as if all the characters in the range were listed there - instead. Wildcard characters "`*`" and "`?`" lose their special - meaning inside a pair of brackets, e.g., "`[*]`" would match an - asterisk and nothing else. + - A pair of brackets that enclose characters matches any single + character from the listed characters, other than a slash "`/`". A + range notation inside them, e.g., "`[a-zA-Z]`", behaves as if all + the characters in the range were listed there instead, and a + leading "`!`" or "`^`" negates the match (still excluding "`/`"). + Note that even a range that apparently includes a slash, like + "`[.-0]`" or "`[/]`", does not match a slash "`/`". Wildcard + characters "`*`" and "`?`" lose their special meaning inside a pair + of brackets, e.g., "`[*]`" matches an asterisk and nothing else. - A backslash ("`\`") can be used to escape any character. E.g., "`\*`" matches a literal asterisk (and "`\a`" matches "`a`", even though -- 2.56.1-817-g003c1d851b