Git development
 help / color / mirror / Atom feed
From: "Matt Hunter" <m@lfurio.us>
To: "Junio C Hamano" <gitster@pobox.com>, <git@vger.kernel.org>
Cc: "Windl, Ulrich" <u.windl@ukr.de>
Subject: Re: [PATCH v3] gitignore: rewrite wildcard description
Date: Sun, 29 Nov 2026 04:16:45 -0500	[thread overview]
Message-ID: <DN7KY29ND3ZO.2AE1ZE3KDJAJ1@lfurio.us> (raw)
In-Reply-To: <xmqqcxrowzjn.fsf_-_@gitster.g>

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.

  reply	other threads:[~2026-11-29  9:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 10:46 Q: .gitignore and asterisk "*" Windl, Ulrich
2026-10-30 16:59 ` Junio C Hamano
2026-11-03  7:33   ` Tuomas Ahola
2026-11-03 12:00     ` [EXT] " Windl, Ulrich
2026-11-03 17:13     ` Junio C Hamano
2026-11-03 17:29       ` Tuomas Ahola
2026-11-03 22:40   ` [PATCH v2] gitignore: rewrite wildcard description Junio C Hamano
2026-11-28  7:13     ` Matt Hunter
2026-11-28 19:03       ` Junio C Hamano
2026-11-28 19:01     ` [PATCH v3] " Junio C Hamano
2026-11-29  9:16       ` Matt Hunter [this message]
2026-11-29 19:50         ` Junio C Hamano
2026-11-30  4:53           ` Matt Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DN7KY29ND3ZO.2AE1ZE3KDJAJ1@lfurio.us \
    --to=m@lfurio.us \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=u.windl@ukr.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox