gitignore.txt: elaborate shell glob syntax

`fnmatch(3)` is a great mention if the intended audience is
programmers. For normal users it's probably better to spell out what
a shell glob is.

This paragraph is updated to roughly tell (or remind) what the main
wildcards are supposed to do. All the details are still hidden away
behind the `fnmatch(3)` wall because bringing the whole specification
here may be too much.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Duy Nguyen 2018-02-01 16:59:15 +07:00 committed by Junio C Hamano
parent fc849d8d6b
commit 2e22a85e5c

View File

@ -102,12 +102,11 @@ PATTERN FORMAT
(relative to the toplevel of the work tree if not from a (relative to the toplevel of the work tree if not from a
`.gitignore` file). `.gitignore` file).
- Otherwise, Git treats the pattern as a shell glob suitable - Otherwise, Git treats the pattern as a shell glob: "`*`" matches
for consumption by fnmatch(3) with the FNM_PATHNAME flag: anything except "`/`", "`?`" matches any one character except "`/`"
wildcards in the pattern will not match a / in the pathname. and "`[]`" matches one character in a selected range. See
For example, "Documentation/{asterisk}.html" matches fnmatch(3) and the FNM_PATHNAME flag for a more detailed
"Documentation/git.html" but not "Documentation/ppc/ppc.html" description.
or "tools/perf/Documentation/perf.html".
- A leading slash matches the beginning of the pathname. - A leading slash matches the beginning of the pathname.
For example, "/{asterisk}.c" matches "cat-file.c" but not For example, "/{asterisk}.c" matches "cat-file.c" but not