Article View: linux.kernel.git
Article #4066Re: [PATCH v3] gitignore: rewrite wildcard description
From: "Matt Hunter"
Date: Sun, 29 Nov 2026 09:16
Date: Sun, 29 Nov 2026 09:16
34 lines
9632 bytes
9632 bytes
On Sat Nov 28, 2026 at 2:01 PM EST, Junio C Hamano wrote:
>
> + - 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.
It's unfortunate how long this bullet becomes with all the interjections
stating "/" is excluded. I tried to write a version of this myself to
condense the explanation. It's not much shorter, but is maybe easier to
follow? I dunno.
- A pair of brackets that enclose characters matches any single
character from the listed characters, and a range notation inside
them, e.g., "`[a-zA-Z]`", behaves as if all the characters in the
range were listed there instead. However a leading "`!`" or "`^`"
negates the list. A slash character "`/`" can not be matched using
this construct, even if the list is negated or a range containing a
slash is present. 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
I noticed there is another reference to fnmatch(3) in the following
bullet, which appears to be the last remaining one in the document.
Technical Details
Message-ID:
<DN7KY29ND3ZO.2AE1ZE3KDJAJ1@lfurio.us>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76620-linux-kernel-git=dewy.ruReferences:
<07b3498d83424cac87221724b371839a@ukr.de> <xmqq5wyjxgyn.fsf@gitster.g> <xmqqh5hx4jz3.fsf_-_@gitster.g> <xmqqcxrowzjn.fsf_-_@gitster.g>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76620-linux-kernel-git=dewy.ru
From: m@lfurio.us ("Matt Hunter")
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v3] gitignore: rewrite wildcard description
Date: Sun, 29 Nov 2026 04:16:45 -0500
Organization: Usenet Network
Message-ID: <DN7KY29ND3ZO.2AE1ZE3KDJAJ1@lfurio.us>
References: <07b3498d83424cac87221724b371839a@ukr.de>
<xmqq5wyjxgyn.fsf@gitster.g> <xmqqh5hx4jz3.fsf_-_@gitster.g>
<xmqqcxrowzjn.fsf_-_@gitster.g>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="1139430"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:54nmhHoN9ospdZIqTYTVAa14IJo= sha256:ytNJiE1ehBtjEn/Wow4l6urVDzmoRDG68vPx3a48ICg=
sha1:TxsxFSUv4FcRuU77i0fuiahzUXM= sha256:YYXt8IQOccGsUPNyLffLGBAzr4RrE9nZqsbdMOJTT4o=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 7B424125F96; Sun, 29 Nov 2026 12:17:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.951
X-Spam-Status: No, score=-1.951 tagged_above=-9999 required=6.31
tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
header.d=lfurio.us
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 2RIA2E0a5Wzb;
Sun, 29 Nov 2026 12:17:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76620-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lfurio.us
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id E4B58125F95; Sun, 29 Nov 2026 12:17:15 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 4EB54244E4; Sun, 29 Nov 2026 09:17:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795943833;
b=IH95TJm2C+8lmxZvwUdoZPORwsKxJP05jJ5Lha3Sco2wUFtab1pLswprt3AswsiSj16W
/S52MPZruTDx58vIs9QTkzsjJy+1ARGCDTroMzgt2A5MP/GurRhqYKGm1gi0sEZtruG0O
NGl2mvpr9uyrj2IrX5eGHHpmE/dKSiUuZy0K/+9vQMszIq+72B5MOR0dNTwBQ7UJQ/CHp
KDER/pbApu1msAraQv3G4H5gsbBci2TqY5kFZ/dwZSk5hIRVaheLTRktURDy6IGx87oB6
YBvWl8yM3+vMZHsd2uWSjdz9YHxT3LHyKOuhRM5CdXORUq85Pxcy0OBOR4Kj0h0rWPA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795943833;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:Mime-Version:
Content-Transfer-Encoding:Content-Type:Date:Message-Id:Subject:Cc:To:
From:X-Mailer:References:In-Reply-To;
bh=v3dliGdFj7S2K4E0x1H9OfMAsbVReQdm0I1ui4563bk=;
b=Otc70Ri0/Ow3PsrLXB3f0DJ38RHqOVJHOIUn8dP5T4+5Pi+aX4uW0pBTVLfBIzCocZvR
m4eAv4k84Mve4AlUH4sJsItR8u4ipp/H8eIvnyCmXOMEmb7sUWxf5bxI0qVRx2V9ElVMd
xrPj0dMbyuEJmxb7stymQdSd+ILKT/FP65QoWItOV0BtUaQgmBx7dNoHrM5uk811y14OP
Un/R7NMIcOk3kForE+jzpLsKckQMsUHq8vZe1kfQJOjnkghmOlc7uJjoYBoexB3gqrIxv
1PeLxbq+ENeJWLOoN2cRXpEn7U46AV80FQ3qSAkGcEPcWk9BhddxA44UZEG7Udzgnsw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b=qOVHoUg9;
dmarc=pass header.from=lfurio.us;
spf=pass smtp.mailfrom=lfurio.us;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id AAC62606A32C;
Sun, 29 Nov 2026 09:17:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b=qOVHoUg9
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=157.230.60.252
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795943832;
b=porksTn+hYt+l7XgSP5M4D7G05NCOkhiqbrmvSi1k34zzv0ZIZsLnghfYZFZs8qUnrmQ
lk0yjefNTr767q5zAwlzG8K7EpPhwshNEfHHWAzzDv6fX6Kp3Zqp2p31rBp/8ot/yxAOR
Lp4pUunQuzjyuCbUx7XhvRR+LgVT+6LqEBd8UEG+YwjQbl9ptDHVt1HrrkkeawCM9pKoP
LjYa1s8r3B4F0CESssEnnHxBxR+zaibeyH3pmN4AyByhegF7+uiouwYa+lEvdUXgkww2t
8GfRzF4ZeOe0C0X6wxopoAdSX0eUNForHWocTIPpuEZgXI31wFJxdLvLp/1BaADm5Ww==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795943832;
h=DMARC-Filter:DKIM-Signature:Received:Mime-Version:
Content-Transfer-Encoding:Content-Type:Date:Message-Id:Subject:Cc:To:
From:X-Mailer:References:In-Reply-To;
bh=v3dliGdFj7S2K4E0x1H9OfMAsbVReQdm0I1ui4563bk=;
b=qCjTMHm7IApaxuDepUPxa0VSHCDZ3VAKjLiE6Ae+tblC3TmKiiLnhZx00EZAGey2Wk4u
Pqr3RpTkIYBhJ8wtTGxjE516JOzAsgofKg5P40qDkHiJUajl2A72F77MzPBeBqi0CSNnR
jxHUxxqik7I+53RlVu3ETPTx/yZqp5N0Tn18Rykwlwuur4NxrePBRs9zNTc9WsMaz+EPk
a+YBg5vzvGHygGzlcVVN/ULdbqiRmcBnt3P8XbX4kPTq7Wdu94d2YdXGtMZkgjX5AhRLr
PrRkSHnwztaDWW4f7jISOV8dZcNeauwzMVwM4TkOSbC956Sab1FBCI4sie3xZvFC/8Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=lfurio.us;
spf=pass smtp.mailfrom=lfurio.us;
dkim=pass header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b=qOVHoUg9;
arc=none smtp.remote-ip=157.230.60.252
X-Received: from mail.normalmode.org (h01.normalmode.org [157.230.60.252])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70E37606A31C
for <git@vger.kernel.org>; Sun, 29 Nov 2026 09:17:12 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 70E37606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lfurio.us
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lfurio.us
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lfurio.us; s=default;
t=1795943831; bh=Wteef1nBJanIoXvmxnHvWFwWIp74e3LFijVJuV5ezdU=;
h=Date:Subject:Cc:To:From:References:In-Reply-To:From;
b=qOVHoUg9FiZY+9fJV3UEYw0o+t3eoh1oSq4vke/fzQtZ9m3oXEJlpI6D3nRGoMMz3
quoTOP4vVfc9UO51WBQ+0gIjIBSKX5Ak7aIaLMpmOiMAHMrcdLaDzHqytJstWZEchZ
pqrSUoS9T1sCq89Q24pz/gCKxKya1Wgqhcbyxvok=
X-Received: by mail.normalmode.org (Postfix) with ESMTPSA id 5015D60665;
Sun, 29 Nov 2026 09:17:11 +0000 (UTC)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-Cc: "Windl, Ulrich" <u.windl@ukr.de>
X-Mailer: aerc 0.21.0-0-g5549850facc2
X-In-Reply-To: <xmqqcxrowzjn.fsf_-_@gitster.g>