Fossil SCM

Brought the globs doc back into line with the underlying implementation, and to mention the new treatement of the empty-dirs setting's value.

wyoung 2023-05-22 22:23 trunk
Commit 2c0b70eb5a758dd456afa215cc5015f0b0a8c91a0b420ef3a59717535d8de6dd
1 file changed +22 -22
+22 -22
--- www/globs.md
+++ www/globs.md
@@ -1,50 +1,50 @@
11
# File Name Glob Patterns
22
3
-
43
A [glob pattern][glob] is a text expression that matches one or more
5
-file names using wild cards familiar to most users of a command line.
6
-For example, `*` is a glob that matches any name at all and
4
+file names using wildcards familiar to most users of a command line.
5
+For example, `*` is a glob that matches any name at all, and
76
`Readme.txt` is a glob that matches exactly one file. For purposes of
8
-Fossil's globs, a file name with a directory prefix is "just a string"
7
+Fossil's globs, a complete path name is just a string,
98
and the globs do not apply any special meaning to the directory part
10
-of the name. Thus the glob `*` matches any name, including any
9
+of the name. Thus, the glob `*` matches any name, including any
1110
directory prefix, and `*/*` matches a name with _one or more_
1211
directory components.
1312
14
-A glob should not be confused with a [regular expression][regexp] (RE),
13
+A glob should not be confused with a [regular expression][regexp] (RE)
1514
even though they use some of the same special characters for similar
16
-purposes, because [they are not fully compatible][greinc] pattern
15
+purposes. [They are not fully compatible][greinc] pattern
1716
matching languages. Fossil uses globs when matching file names with the
1817
settings described in this document, not REs.
1918
2019
[glob]: https://en.wikipedia.org/wiki/Glob_(programming)
2120
[greinc]: https://unix.stackexchange.com/a/57958/138
2221
[regexp]: https://en.wikipedia.org/wiki/Regular_expression
2322
24
-These settings hold one or more file glob patterns to cause Fossil to
23
+Fossil’s `*-glob` settings hold one or more patterns to cause Fossil to
2524
give matching named files special treatment. Glob patterns are also
2625
accepted in options to certain commands and as query parameters to
27
-certain Fossil UI web pages.
26
+certain Fossil UI web pages. For consistency, settings such as
27
+`empty-dirs` are parsed as a glob even though they aren’t then *applied*
28
+as a glob since it allows [the same syntax rules](#syntax) to apply.
2829
2930
Where Fossil also accepts globs in commands, this handling may interact
3031
with your OS’s command shell or its C runtime system, because they may
3132
have their own glob pattern handling. We will detail such interactions
3233
below.
3334
3435
35
-## Syntax
36
+## <a id="syntax"></a>Syntax
3637
3738
Where Fossil accepts glob patterns, it will usually accept a *list* of
38
-such patterns, each individual pattern separated from the others
39
-by white space or commas. If a glob must contain white spaces or
40
-commas, it can be quoted with either single or double quotation marks.
41
-A list is said to match if any one glob in the list
42
-matches.
43
-
44
-A glob pattern matches a given file name if it successfully consumes and
45
-matches the *entire* name. Partial matches are failed matches.
39
+individual patterns separated from the others
40
+by whitespace or commas. Whitespace and
41
+commas may be quoted with either single or double quotation marks.
42
+A list matches a file when any pattern in that list matches.
43
+
44
+A pattern must consume and
45
+match the *entire* file name to succeed. Partial matches are failed matches.
4646
4747
Most characters in a glob pattern consume a single character of the file
4848
name and must match it exactly. For instance, “a” in a glob simply
4949
matches the letter “a” in the file name unless it is inside a special
5050
character sequence.
@@ -61,11 +61,11 @@
6161
6262
Note that unlike [POSIX globs][pg], these special characters and
6363
sequences are allowed to match `/` directory separators as well as the
6464
initial `.` in the name of a hidden file or directory. This is because
6565
Fossil file names are stored as complete path names. The distinction
66
-between file name and directory name is “below” Fossil in this sense.
66
+between file name and directory name is “underneath” Fossil in this sense.
6767
6868
[pg]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
6969
7070
The bracket expressions above require some additional explanation:
7171
@@ -357,16 +357,16 @@
357357
358358
It bears repeating that the two glob patterns here are not interpreted
359359
the same way when running this command from a *subdirectory* of the top
360360
checkout directory as when running it at the top of the checkout tree.
361361
If these files were in a subdirectory of the checkout tree called `doc`
362
-and that was your current working directory, the command would have to
363
-be:
362
+and that was your current working directory, the command would instead
363
+have to be:
364364
365365
$ fossil add --ignore "'doc/REALLY SECRET STUFF.txt'" READ*
366366
367
-instead. The Fossil glob pattern still needs the `doc/` prefix because
367
+The Fossil glob pattern still needs the `doc/` prefix because
368368
Fossil always interprets glob patterns from the base of the checkout
369369
directory, not from the current working directory as POSIX shells do.
370370
371371
When in doubt, use `fossil status` after running commands like the
372372
above to make sure the right set of files were scheduled for insertion
373373
--- www/globs.md
+++ www/globs.md
@@ -1,50 +1,50 @@
1 # File Name Glob Patterns
2
3
4 A [glob pattern][glob] is a text expression that matches one or more
5 file names using wild cards familiar to most users of a command line.
6 For example, `*` is a glob that matches any name at all and
7 `Readme.txt` is a glob that matches exactly one file. For purposes of
8 Fossil's globs, a file name with a directory prefix is "just a string"
9 and the globs do not apply any special meaning to the directory part
10 of the name. Thus the glob `*` matches any name, including any
11 directory prefix, and `*/*` matches a name with _one or more_
12 directory components.
13
14 A glob should not be confused with a [regular expression][regexp] (RE),
15 even though they use some of the same special characters for similar
16 purposes, because [they are not fully compatible][greinc] pattern
17 matching languages. Fossil uses globs when matching file names with the
18 settings described in this document, not REs.
19
20 [glob]: https://en.wikipedia.org/wiki/Glob_(programming)
21 [greinc]: https://unix.stackexchange.com/a/57958/138
22 [regexp]: https://en.wikipedia.org/wiki/Regular_expression
23
24 These settings hold one or more file glob patterns to cause Fossil to
25 give matching named files special treatment. Glob patterns are also
26 accepted in options to certain commands and as query parameters to
27 certain Fossil UI web pages.
 
 
28
29 Where Fossil also accepts globs in commands, this handling may interact
30 with your OS’s command shell or its C runtime system, because they may
31 have their own glob pattern handling. We will detail such interactions
32 below.
33
34
35 ## Syntax
36
37 Where Fossil accepts glob patterns, it will usually accept a *list* of
38 such patterns, each individual pattern separated from the others
39 by white space or commas. If a glob must contain white spaces or
40 commas, it can be quoted with either single or double quotation marks.
41 A list is said to match if any one glob in the list
42 matches.
43
44 A glob pattern matches a given file name if it successfully consumes and
45 matches the *entire* name. Partial matches are failed matches.
46
47 Most characters in a glob pattern consume a single character of the file
48 name and must match it exactly. For instance, “a” in a glob simply
49 matches the letter “a” in the file name unless it is inside a special
50 character sequence.
@@ -61,11 +61,11 @@
61
62 Note that unlike [POSIX globs][pg], these special characters and
63 sequences are allowed to match `/` directory separators as well as the
64 initial `.` in the name of a hidden file or directory. This is because
65 Fossil file names are stored as complete path names. The distinction
66 between file name and directory name is “below” Fossil in this sense.
67
68 [pg]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
69
70 The bracket expressions above require some additional explanation:
71
@@ -357,16 +357,16 @@
357
358 It bears repeating that the two glob patterns here are not interpreted
359 the same way when running this command from a *subdirectory* of the top
360 checkout directory as when running it at the top of the checkout tree.
361 If these files were in a subdirectory of the checkout tree called `doc`
362 and that was your current working directory, the command would have to
363 be:
364
365 $ fossil add --ignore "'doc/REALLY SECRET STUFF.txt'" READ*
366
367 instead. The Fossil glob pattern still needs the `doc/` prefix because
368 Fossil always interprets glob patterns from the base of the checkout
369 directory, not from the current working directory as POSIX shells do.
370
371 When in doubt, use `fossil status` after running commands like the
372 above to make sure the right set of files were scheduled for insertion
373
--- www/globs.md
+++ www/globs.md
@@ -1,50 +1,50 @@
1 # File Name Glob Patterns
2
 
3 A [glob pattern][glob] is a text expression that matches one or more
4 file names using wildcards familiar to most users of a command line.
5 For example, `*` is a glob that matches any name at all, and
6 `Readme.txt` is a glob that matches exactly one file. For purposes of
7 Fossil's globs, a complete path name is just a string,
8 and the globs do not apply any special meaning to the directory part
9 of the name. Thus, the glob `*` matches any name, including any
10 directory prefix, and `*/*` matches a name with _one or more_
11 directory components.
12
13 A glob should not be confused with a [regular expression][regexp] (RE)
14 even though they use some of the same special characters for similar
15 purposes. [They are not fully compatible][greinc] pattern
16 matching languages. Fossil uses globs when matching file names with the
17 settings described in this document, not REs.
18
19 [glob]: https://en.wikipedia.org/wiki/Glob_(programming)
20 [greinc]: https://unix.stackexchange.com/a/57958/138
21 [regexp]: https://en.wikipedia.org/wiki/Regular_expression
22
23 Fossil’s `*-glob` settings hold one or more patterns to cause Fossil to
24 give matching named files special treatment. Glob patterns are also
25 accepted in options to certain commands and as query parameters to
26 certain Fossil UI web pages. For consistency, settings such as
27 `empty-dirs` are parsed as a glob even though they aren’t then *applied*
28 as a glob since it allows [the same syntax rules](#syntax) to apply.
29
30 Where Fossil also accepts globs in commands, this handling may interact
31 with your OS’s command shell or its C runtime system, because they may
32 have their own glob pattern handling. We will detail such interactions
33 below.
34
35
36 ## <a id="syntax"></a>Syntax
37
38 Where Fossil accepts glob patterns, it will usually accept a *list* of
39 individual patterns separated from the others
40 by whitespace or commas. Whitespace and
41 commas may be quoted with either single or double quotation marks.
42 A list matches a file when any pattern in that list matches.
43
44 A pattern must consume and
45 match the *entire* file name to succeed. Partial matches are failed matches.
 
46
47 Most characters in a glob pattern consume a single character of the file
48 name and must match it exactly. For instance, “a” in a glob simply
49 matches the letter “a” in the file name unless it is inside a special
50 character sequence.
@@ -61,11 +61,11 @@
61
62 Note that unlike [POSIX globs][pg], these special characters and
63 sequences are allowed to match `/` directory separators as well as the
64 initial `.` in the name of a hidden file or directory. This is because
65 Fossil file names are stored as complete path names. The distinction
66 between file name and directory name is “underneath” Fossil in this sense.
67
68 [pg]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
69
70 The bracket expressions above require some additional explanation:
71
@@ -357,16 +357,16 @@
357
358 It bears repeating that the two glob patterns here are not interpreted
359 the same way when running this command from a *subdirectory* of the top
360 checkout directory as when running it at the top of the checkout tree.
361 If these files were in a subdirectory of the checkout tree called `doc`
362 and that was your current working directory, the command would instead
363 have to be:
364
365 $ fossil add --ignore "'doc/REALLY SECRET STUFF.txt'" READ*
366
367 The Fossil glob pattern still needs the `doc/` prefix because
368 Fossil always interprets glob patterns from the base of the checkout
369 directory, not from the current working directory as POSIX shells do.
370
371 When in doubt, use `fossil status` after running commands like the
372 above to make sure the right set of files were scheduled for insertion
373

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button