Fossil SCM

Use tables throughout globs.md

andygoth 2017-09-24 04:42 UTC andygoth-annotation-enhancements
Commit 7f2689b1b5411c59a3cb1b52c0175262582962962e84c0ac9cf2ea1230e70d79
1 file changed +46 -55
+46 -55
--- www/globs.md
+++ www/globs.md
@@ -48,14 +48,16 @@
4848
4949
Special characters (and special character sequences) consume zero or
5050
more characters from the target and describe what matches. The special
5151
characters (and sequences) are:
5252
53
- * `*` Matches any sequence of zero or more characters;
54
- * `?` Matches exactly one character;
55
- * `[...]` Matches one character from the enclosed list of characters; and
56
- * `[^...]` Matches one character not in the enclosed list.
53
+:Pattern |:Effect
54
+---------------------------------------------------------------------
55
+`*` | Matches any sequence of zero or more characters
56
+`?` | Matches exactly one character
57
+`[...]` | Matches one character from the enclosed list of characters
58
+`[^...]` | Matches one character not in the enclosed list
5759
5860
Special character sequences have some additional features:
5961
6062
* A range of characters may be specified with `-`, so `[a-d]` matches
6163
exactly the same characters as `[abcd]`. Ranges reflect Unicode
@@ -77,19 +79,20 @@
7779
separators as well as the initial `.` in the name of a hidden
7880
file or directory.
7981
8082
Some examples of character lists:
8183
82
- * `[a-d]` Matches any one of `a`, `b`, `c`, or `d` but not `ä`;
83
- * `[^a-d]` Matches exactly one character other than `a`, `b`, `c`,
84
- or `d`;
85
- * `[0-9a-fA-F]` Matches exactly one hexadecimal digit;
86
- * `[a-]` Matches either `a` or `-`;
87
- * `[][]` Matches either `]` or `[`;
88
- * `[^]]` Matches exactly one character other than `]`;
89
- * `[]^]` Matches either `]` or `^`; and
90
- * `[^-]` Matches exactly one character other than `-`.
84
+:Pattern |:Effect
85
+---------------------------------------------------------------------
86
+`[a-d]` | Matches any one of `a`, `b`, `c`, or `d` but not `ä`
87
+`[^a-d]` | Matches exactly one character other than `a`, `b`, `c`, or `d`
88
+`[0-9a-fA-F]` | Matches exactly one hexadecimal digit
89
+`[a-]` | Matches either `a` or `-`
90
+`[][]` | Matches either `]` or `[`
91
+`[^]]` | Matches exactly one character other than `]`
92
+`[]^]` | Matches either `]` or `^`
93
+`[^-]` | Matches exactly one character other than `-`
9194
9295
White space means the specific ASCII characters TAB, LF, VT, FF, CR,
9396
and SPACE. Note that this does not include any of the many additional
9497
spacing characters available in Unicode, and specifically does not
9598
include U+00A0 NO-BREAK SPACE.
@@ -127,44 +130,33 @@
127130
case insensitive. That is, on Windows, the names `ReadMe` and `README`
128131
are names of the same file; on Unix they are different files.
129132
130133
Some example cases:
131134
132
- * The glob `README` matches only a file named `README` in the root of
133
- the tree. It does not match a file named `src/README` because it
134
- does not include any characters that consume (and match) the
135
- `src/` part.
136
- * The glob `*/README` does match `src/README`. Unlike Unix file
137
- globs, it also matches `src/library/README`. However it does not
138
- match the file `README` in the root of the tree.
139
- * The glob `*README` does match `src/README` as well as the file
140
- `README` in the root of the tree as well as `foo/bar/README` or
141
- any other file named `README` in the tree. However, it also
142
- matches `A-DIFFERENT-README` and `src/DO-NOT-README`, or any other
143
- file whose name ends with `README`.
144
- * The glob `src/README` does match the file named `src\README` on
145
- Windows because all directory separators are rewritten as `/` in
146
- the canonical name before the glob is matched. This makes it much
147
- easier to write globs that work on both Unix and Windows.
148
- * The glob `*.[ch]` matches every C source or header file in the
149
- tree at the root or at any depth. Again, this is (deliberately)
150
- different from Unix file globs and Windows wild cards.
151
-
135
+:Pattern |:Effect
136
+--------------------------------------------------------------------------------
137
+`README` | Matches only a file named `README` in the root of the tree. It does not match a file named `src/README` because it does not include any characters that consume (and match) the `src/` part.
138
+`*/README` | Matches `src/README`. Unlike Unix file globs, it also matches `src/library/README`. However it does not match the file `README` in the root of the tree.
139
+`*README` | Matches `src/README` as well as the file `README` in the root of the tree as well as `foo/bar/README` or any other file named `README` in the tree. However, it also matches `A-DIFFERENT-README` and `src/DO-NOT-README`, or any other file whose name ends with `README`.
140
+`src/README` | Matches `src\README` on Windows because all directory separators are rewritten as `/` in the canonical name before the glob is matched. This makes it much easier to write globs that work on both Unix and Windows.
141
+`*.[ch]` | Matches every C source or header file in the tree at the root or at any depth. Again, this is (deliberately) different from Unix file globs and Windows wild cards.
152142
153143
## Where Globs are Used
154144
155145
### Settings that are Globs
156146
157147
These settings are all lists of glob patterns:
158148
159
- * `binary-glob`
160
- * `clean-glob`
161
- * `crlf-glob`
162
- * `crnl-glob`
163
- * `encoding-glob`
164
- * `ignore-glob`
165
- * `keep-glob`
149
+:Setting |:Description
150
+--------------------------------------------------------------------------------
151
+`binary-glob` | Files that should be treated as binary files for committing and merging purposes
152
+`clean-glob` | Files that the [`clean`][] command will delete without prompting or allowing undo
153
+`crlf-glob` | Files in which it is okay to have `CR`, `CR`+`LF` or mixed line endings. Set to "`*`" to disable CR+LF checking
154
+`crnl-glob` | Alias for the `crlf-glob` setting
155
+`encoding-glob` | Files that the [`commit`][] command will ignore when issuing warnings about text files that may use another encoding than ASCII or UTF-8. Set to "`*`" to disable encoding checking
156
+`ignore-glob` | Files that the [`add`][], [`addremove`][], [`clean`][], and [`extras`][] commands will ignore
157
+`keep-glob` | Files that the [`clean`][] command will keep
166158
167159
All may be [versioned, local, or global](settings.wiki). Use `fossil
168160
settings` to manage local and global settings, or a file in the
169161
repository's `.fossil-settings/` folder at the root of the tree named
170162
for each for versioned setting.
@@ -191,10 +183,11 @@
191183
192184
* [`add`][]
193185
* [`addremove`][]
194186
* [`changes`][]
195187
* [`clean`][]
188
+ * [`commit`][]
196189
* [`extras`][]
197190
* [`merge`][]
198191
* [`settings`][]
199192
* [`status`][]
200193
* [`unset`][]
@@ -211,10 +204,11 @@
211204
212205
[`add`]: /help?cmd=add
213206
[`addremove`]: /help?cmd=addremove
214207
[`changes`]: /help?cmd=changes
215208
[`clean`]: /help?cmd=clean
209
+[`commit`]: /help?cmd=commit
216210
[`extras`]: /help?cmd=extras
217211
[`merge`]: /help?cmd=merge
218212
[`settings`]: /help?cmd=settings
219213
[`status`]: /help?cmd=status
220214
[`unset`]: /help?cmd=unset
@@ -517,24 +511,21 @@
517511
front of the function that implements the command or page in files
518512
`src/*.c`. (Fossil's build system creates the tables used to dispatch
519513
commands at build time by searching the sources for those comments.) A
520514
few starting points:
521515
522
- * [`src/glob.c`][glob.c] implements glob pattern list loading,
523
- parsing, and matching.
524
- * [`src/file.c`][file.c] implements various kinds of canonical
525
- names of a file.
526
-
527
-
528
-[glob.c]: https://www.fossil-scm.org/index.html/file/src/glob.c
529
-[file.c]: https://www.fossil-scm.org/index.html/file/src/file.c
516
+:File |:Description
517
+--------------------------------------------------------------------------------
518
+[`src/glob.c`][] | Implementation of glob pattern list loading, parsing, and matching.
519
+[`src/file.c`][] | Implementation of various kinds of canonical names of a file.
520
+
521
+[`src/glob.c`]: https://www.fossil-scm.org/index.html/file/src/glob.c
522
+[`src/file.c`]: https://www.fossil-scm.org/index.html/file/src/file.c
530523
531524
The actual pattern matching is implemented in SQL, so the
532525
documentation for `GLOB` and the other string matching operators in
533526
[SQLite] (https://sqlite.org/lang_expr.html#like) is useful. Of
534
-course, the SQLite source code and test harnesses also make
535
-entertaining reading:
536
-
537
- * `src/func.c` [lines 570-768]
538
- (https://www.sqlite.org/src/artifact?name=9d52522cc8ae7f5c&ln=570-768)
539
- * `test/expr.test` [lines 586-673]
540
- (https://www.sqlite.org/src/artifact?name=66a2c9ac34f74f03&ln=586-673)
527
+course, the SQLite [source code]
528
+(https://www.sqlite.org/src/artifact?name=9d52522cc8ae7f5c&ln=570-768)
529
+and [test harnesses]
530
+(https://www.sqlite.org/src/artifact?name=66a2c9ac34f74f03&ln=586-673)
531
+also make entertaining reading.
541532
--- www/globs.md
+++ www/globs.md
@@ -48,14 +48,16 @@
48
49 Special characters (and special character sequences) consume zero or
50 more characters from the target and describe what matches. The special
51 characters (and sequences) are:
52
53 * `*` Matches any sequence of zero or more characters;
54 * `?` Matches exactly one character;
55 * `[...]` Matches one character from the enclosed list of characters; and
56 * `[^...]` Matches one character not in the enclosed list.
 
 
57
58 Special character sequences have some additional features:
59
60 * A range of characters may be specified with `-`, so `[a-d]` matches
61 exactly the same characters as `[abcd]`. Ranges reflect Unicode
@@ -77,19 +79,20 @@
77 separators as well as the initial `.` in the name of a hidden
78 file or directory.
79
80 Some examples of character lists:
81
82 * `[a-d]` Matches any one of `a`, `b`, `c`, or `d` but not `ä`;
83 * `[^a-d]` Matches exactly one character other than `a`, `b`, `c`,
84 or `d`;
85 * `[0-9a-fA-F]` Matches exactly one hexadecimal digit;
86 * `[a-]` Matches either `a` or `-`;
87 * `[][]` Matches either `]` or `[`;
88 * `[^]]` Matches exactly one character other than `]`;
89 * `[]^]` Matches either `]` or `^`; and
90 * `[^-]` Matches exactly one character other than `-`.
 
91
92 White space means the specific ASCII characters TAB, LF, VT, FF, CR,
93 and SPACE. Note that this does not include any of the many additional
94 spacing characters available in Unicode, and specifically does not
95 include U+00A0 NO-BREAK SPACE.
@@ -127,44 +130,33 @@
127 case insensitive. That is, on Windows, the names `ReadMe` and `README`
128 are names of the same file; on Unix they are different files.
129
130 Some example cases:
131
132 * The glob `README` matches only a file named `README` in the root of
133 the tree. It does not match a file named `src/README` because it
134 does not include any characters that consume (and match) the
135 `src/` part.
136 * The glob `*/README` does match `src/README`. Unlike Unix file
137 globs, it also matches `src/library/README`. However it does not
138 match the file `README` in the root of the tree.
139 * The glob `*README` does match `src/README` as well as the file
140 `README` in the root of the tree as well as `foo/bar/README` or
141 any other file named `README` in the tree. However, it also
142 matches `A-DIFFERENT-README` and `src/DO-NOT-README`, or any other
143 file whose name ends with `README`.
144 * The glob `src/README` does match the file named `src\README` on
145 Windows because all directory separators are rewritten as `/` in
146 the canonical name before the glob is matched. This makes it much
147 easier to write globs that work on both Unix and Windows.
148 * The glob `*.[ch]` matches every C source or header file in the
149 tree at the root or at any depth. Again, this is (deliberately)
150 different from Unix file globs and Windows wild cards.
151
152
153 ## Where Globs are Used
154
155 ### Settings that are Globs
156
157 These settings are all lists of glob patterns:
158
159 * `binary-glob`
160 * `clean-glob`
161 * `crlf-glob`
162 * `crnl-glob`
163 * `encoding-glob`
164 * `ignore-glob`
165 * `keep-glob`
 
 
166
167 All may be [versioned, local, or global](settings.wiki). Use `fossil
168 settings` to manage local and global settings, or a file in the
169 repository's `.fossil-settings/` folder at the root of the tree named
170 for each for versioned setting.
@@ -191,10 +183,11 @@
191
192 * [`add`][]
193 * [`addremove`][]
194 * [`changes`][]
195 * [`clean`][]
 
196 * [`extras`][]
197 * [`merge`][]
198 * [`settings`][]
199 * [`status`][]
200 * [`unset`][]
@@ -211,10 +204,11 @@
211
212 [`add`]: /help?cmd=add
213 [`addremove`]: /help?cmd=addremove
214 [`changes`]: /help?cmd=changes
215 [`clean`]: /help?cmd=clean
 
216 [`extras`]: /help?cmd=extras
217 [`merge`]: /help?cmd=merge
218 [`settings`]: /help?cmd=settings
219 [`status`]: /help?cmd=status
220 [`unset`]: /help?cmd=unset
@@ -517,24 +511,21 @@
517 front of the function that implements the command or page in files
518 `src/*.c`. (Fossil's build system creates the tables used to dispatch
519 commands at build time by searching the sources for those comments.) A
520 few starting points:
521
522 * [`src/glob.c`][glob.c] implements glob pattern list loading,
523 parsing, and matching.
524 * [`src/file.c`][file.c] implements various kinds of canonical
525 names of a file.
526
527
528 [glob.c]: https://www.fossil-scm.org/index.html/file/src/glob.c
529 [file.c]: https://www.fossil-scm.org/index.html/file/src/file.c
530
531 The actual pattern matching is implemented in SQL, so the
532 documentation for `GLOB` and the other string matching operators in
533 [SQLite] (https://sqlite.org/lang_expr.html#like) is useful. Of
534 course, the SQLite source code and test harnesses also make
535 entertaining reading:
536
537 * `src/func.c` [lines 570-768]
538 (https://www.sqlite.org/src/artifact?name=9d52522cc8ae7f5c&ln=570-768)
539 * `test/expr.test` [lines 586-673]
540 (https://www.sqlite.org/src/artifact?name=66a2c9ac34f74f03&ln=586-673)
541
--- www/globs.md
+++ www/globs.md
@@ -48,14 +48,16 @@
48
49 Special characters (and special character sequences) consume zero or
50 more characters from the target and describe what matches. The special
51 characters (and sequences) are:
52
53 :Pattern |:Effect
54 ---------------------------------------------------------------------
55 `*` | Matches any sequence of zero or more characters
56 `?` | Matches exactly one character
57 `[...]` | Matches one character from the enclosed list of characters
58 `[^...]` | Matches one character not in the enclosed list
59
60 Special character sequences have some additional features:
61
62 * A range of characters may be specified with `-`, so `[a-d]` matches
63 exactly the same characters as `[abcd]`. Ranges reflect Unicode
@@ -77,19 +79,20 @@
79 separators as well as the initial `.` in the name of a hidden
80 file or directory.
81
82 Some examples of character lists:
83
84 :Pattern |:Effect
85 ---------------------------------------------------------------------
86 `[a-d]` | Matches any one of `a`, `b`, `c`, or `d` but not `ä`
87 `[^a-d]` | Matches exactly one character other than `a`, `b`, `c`, or `d`
88 `[0-9a-fA-F]` | Matches exactly one hexadecimal digit
89 `[a-]` | Matches either `a` or `-`
90 `[][]` | Matches either `]` or `[`
91 `[^]]` | Matches exactly one character other than `]`
92 `[]^]` | Matches either `]` or `^`
93 `[^-]` | Matches exactly one character other than `-`
94
95 White space means the specific ASCII characters TAB, LF, VT, FF, CR,
96 and SPACE. Note that this does not include any of the many additional
97 spacing characters available in Unicode, and specifically does not
98 include U+00A0 NO-BREAK SPACE.
@@ -127,44 +130,33 @@
130 case insensitive. That is, on Windows, the names `ReadMe` and `README`
131 are names of the same file; on Unix they are different files.
132
133 Some example cases:
134
135 :Pattern |:Effect
136 --------------------------------------------------------------------------------
137 `README` | Matches only a file named `README` in the root of the tree. It does not match a file named `src/README` because it does not include any characters that consume (and match) the `src/` part.
138 `*/README` | Matches `src/README`. Unlike Unix file globs, it also matches `src/library/README`. However it does not match the file `README` in the root of the tree.
139 `*README` | Matches `src/README` as well as the file `README` in the root of the tree as well as `foo/bar/README` or any other file named `README` in the tree. However, it also matches `A-DIFFERENT-README` and `src/DO-NOT-README`, or any other file whose name ends with `README`.
140 `src/README` | Matches `src\README` on Windows because all directory separators are rewritten as `/` in the canonical name before the glob is matched. This makes it much easier to write globs that work on both Unix and Windows.
141 `*.[ch]` | Matches every C source or header file in the tree at the root or at any depth. Again, this is (deliberately) different from Unix file globs and Windows wild cards.
 
 
 
 
 
 
 
 
 
 
 
 
 
142
143 ## Where Globs are Used
144
145 ### Settings that are Globs
146
147 These settings are all lists of glob patterns:
148
149 :Setting |:Description
150 --------------------------------------------------------------------------------
151 `binary-glob` | Files that should be treated as binary files for committing and merging purposes
152 `clean-glob` | Files that the [`clean`][] command will delete without prompting or allowing undo
153 `crlf-glob` | Files in which it is okay to have `CR`, `CR`+`LF` or mixed line endings. Set to "`*`" to disable CR+LF checking
154 `crnl-glob` | Alias for the `crlf-glob` setting
155 `encoding-glob` | Files that the [`commit`][] command will ignore when issuing warnings about text files that may use another encoding than ASCII or UTF-8. Set to "`*`" to disable encoding checking
156 `ignore-glob` | Files that the [`add`][], [`addremove`][], [`clean`][], and [`extras`][] commands will ignore
157 `keep-glob` | Files that the [`clean`][] command will keep
158
159 All may be [versioned, local, or global](settings.wiki). Use `fossil
160 settings` to manage local and global settings, or a file in the
161 repository's `.fossil-settings/` folder at the root of the tree named
162 for each for versioned setting.
@@ -191,10 +183,11 @@
183
184 * [`add`][]
185 * [`addremove`][]
186 * [`changes`][]
187 * [`clean`][]
188 * [`commit`][]
189 * [`extras`][]
190 * [`merge`][]
191 * [`settings`][]
192 * [`status`][]
193 * [`unset`][]
@@ -211,10 +204,11 @@
204
205 [`add`]: /help?cmd=add
206 [`addremove`]: /help?cmd=addremove
207 [`changes`]: /help?cmd=changes
208 [`clean`]: /help?cmd=clean
209 [`commit`]: /help?cmd=commit
210 [`extras`]: /help?cmd=extras
211 [`merge`]: /help?cmd=merge
212 [`settings`]: /help?cmd=settings
213 [`status`]: /help?cmd=status
214 [`unset`]: /help?cmd=unset
@@ -517,24 +511,21 @@
511 front of the function that implements the command or page in files
512 `src/*.c`. (Fossil's build system creates the tables used to dispatch
513 commands at build time by searching the sources for those comments.) A
514 few starting points:
515
516 :File |:Description
517 --------------------------------------------------------------------------------
518 [`src/glob.c`][] | Implementation of glob pattern list loading, parsing, and matching.
519 [`src/file.c`][] | Implementation of various kinds of canonical names of a file.
520
521 [`src/glob.c`]: https://www.fossil-scm.org/index.html/file/src/glob.c
522 [`src/file.c`]: https://www.fossil-scm.org/index.html/file/src/file.c
 
523
524 The actual pattern matching is implemented in SQL, so the
525 documentation for `GLOB` and the other string matching operators in
526 [SQLite] (https://sqlite.org/lang_expr.html#like) is useful. Of
527 course, the SQLite [source code]
528 (https://www.sqlite.org/src/artifact?name=9d52522cc8ae7f5c&ln=570-768)
529 and [test harnesses]
530 (https://www.sqlite.org/src/artifact?name=66a2c9ac34f74f03&ln=586-673)
531 also make entertaining reading.
 
 
532

Keyboard Shortcuts

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