From: "Matt Hunter" <m@lfurio.us>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: <git@vger.kernel.org>, "Windl, Ulrich" <u.windl@ukr.de>
Subject: Re: [PATCH v3] gitignore: rewrite wildcard description
Date: Sun, 29 Nov 2026 23:53:39 -0500 [thread overview]
Message-ID: <DN89Z5SM4TOZ.1O2FW6P94MMPS@lfurio.us> (raw)
In-Reply-To: <xmqqqzg3fmcy.fsf@gitster.g>
On Sun Nov 29, 2026 at 2:50 PM EST, Junio C Hamano wrote:
>
> This improves over mine on two points by unifying the cases to have
> individual characters case and character range in a pair of
> brackets, and by stating more explicitly how negation and '/'
> exclusion interacts. It probably makes sense to fold the [*?] into
> the description on "any single character from the listed characters".
>
> ... listed there instead. Wildcard characters "`*`" and
> "`?`"' lose their special meaning inside a pair of brackets,
> e.g., ... nothing else.
Agreed
>
> I personally feel that this also disimproves on two points, though.
>
> - "However a leading ... negates the list." makes it sound as if it
> is a bad thing. It is an additional useful feature, and I'd
> prefer to phrase it as such. E.g.,
>
> The list can be negated by having "`!`" or "`^`" as the
> first character in the bracket, e.g., "`[^0-9]`" matches
> characters that are not ASCII digits.
If the interpretation here of "negates the list" is to apply some bad
attribute to the list, you could revert back to your phrasing "negates
the match" instead. Another possible wording is "invert" instead of
"negate".
I like what you propose here too, especially if splitting the bullet up
like mentioned below. Though as a separate bullet, I would make this
change for context:
s/The list/A bracketed list/ (or something like that)
>
> - "A slash character cannot be matched" also makes it sound as if
> it is a bad thing. Wildcard sequence matching only one path
> component at a time is a feature, and I'd prefer to phrase it as
> such.
>
> Neither bracket construct (negated or not) nor a wildcard
> matches the slash "`!`" character, which is matched only by
"`/`"
> itself (e.g., the pattern "`a/b*`" matches `a/bc` but not
> `a/b/c`).
This reads well as its own bullet as well.
>
> Also, it might make it easier to read if we split this large single
> bullet into three, by the way. (1) brackets, (2) negation, (3)
> slash-exclusion.
>
> What do you think?
As hinted above, I'm in favor of splitting it up this way.
prev parent reply other threads:[~2026-11-30 4:54 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
2026-11-29 19:50 ` Junio C Hamano
2026-11-30 4:53 ` Matt Hunter [this message]
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=DN89Z5SM4TOZ.1O2FW6P94MMPS@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