Re: Q: .gitignore and asterisk "*"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 3, 2026, 17:13 UTC
- Message-ID
- <xmqqzevpald4.fsf@gitster.g>
- In-Reply-To
- <20261103073317.DATcL%taahol@utu.fi>
Tuomas Ahola <taahol@utu.fi> writes:
> Junio C Hamano <gitster@pobox.com> wrote: > >> "Windl, Ulrich" <u.windl@ukr.de> writes:
Please trim the lines that do not have any relevance to what you are going to comment on from your quoted material.
Show 10 quoted lines
>> - - 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 string of any length, and a question mark > > It's not unreasonable at all to call the empty string "a string of no length", > so it is still a bit ambiguous whether it qualifies as a string of any length. > I would suggest s/of any length/of length of zero or more/.
A string of no length falls within the set of strings of any length, so I do not see any ambiguity there.
"A string of length of zero or more" is a roundabout way to say "any string" as by definition there is no string of negative length. Perhaps that is good enough?