Skip to content

Commit 2e22a85

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fc849d8 commit 2e22a85

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Documentation/gitignore.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,11 @@ PATTERN FORMAT
102102
(relative to the toplevel of the work tree if not from a
103103
`.gitignore` file).
104104

105-
- Otherwise, Git treats the pattern as a shell glob suitable
106-
for consumption by fnmatch(3) with the FNM_PATHNAME flag:
107-
wildcards in the pattern will not match a / in the pathname.
108-
For example, "Documentation/{asterisk}.html" matches
109-
"Documentation/git.html" but not "Documentation/ppc/ppc.html"
110-
or "tools/perf/Documentation/perf.html".
105+
- Otherwise, Git treats the pattern as a shell glob: "`*`" matches
106+
anything except "`/`", "`?`" matches any one character except "`/`"
107+
and "`[]`" matches one character in a selected range. See
108+
fnmatch(3) and the FNM_PATHNAME flag for a more detailed
109+
description.
111110

112111
- A leading slash matches the beginning of the pathname.
113112
For example, "/{asterisk}.c" matches "cat-file.c" but not

0 commit comments

Comments
 (0)