Fossil SCM

fossil-scm / www / globs.md
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](#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 by whitespace or commas.
40
41
The parser allows whitespace and commas in a pattern by quoting _the
42
entire pattern_ with either single or double quotation marks. Internal
43
quotation marks are treated literally. Moreover, a pattern that begins
44
with a quote mark ends when the first instance of the same mark occurs,
45
_not_ at a whitespace or comma. Thus, this:
46
47
"foo bar"qux
48
49
…constitutes _two_ patterns rather than one with an embedded space, in
50
contravention of normal shell quoting rules.
51
52
A list matches a file when any pattern in that list matches.
53
54
A pattern must consume and
55
match the *entire* file name to succeed. Partial matches are failed matches.
56
57
Most characters in a glob pattern consume a single character of the file
58
name and must match it exactly. For instance, “a” in a glob simply
59
matches the letter “a” in the file name unless it is inside a special
60
character sequence.
61
62
Other characters have special meaning, and they may include otherwise
63
normal characters to give them special meaning:
64
65
:Pattern |:Effect
66
---------------------------------------------------------------------
67
`*` | Matches any sequence of zero or more characters
68
`?` | Matches exactly one character
69
`[...]` | Matches one character from the enclosed list of characters
70
`[^...]` | Matches one character *not* in the enclosed list
71
72
Note that unlike [POSIX globs][pg], these special characters and
73
sequences are allowed to match `/` directory separators as well as the
74
initial `.` in the name of a hidden file or directory. This is because
75
Fossil file names are stored as complete path names. The distinction
76
between file name and directory name is “underneath” Fossil in this sense.
77
78
[pg]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
79
80
The bracket expressions above require some additional explanation:
81
82
* A range of characters may be specified with `-`, so `[a-f]` matches
83
exactly the same characters as `[abcdef]`. Ranges reflect Unicode
84
code points without any locale-specific collation sequence.
85
Therefore, this particular sequence never matches the Unicode
86
pre-composed character `é`, for example. (U+00E9)
87
88
* This dependence on character/code point ordering may have other
89
effects to surprise you. For example, the glob `[A-z]` not only
90
matches upper and lowercase ASCII letters, it also matches several
91
punctuation characters placed between `Z` and `a` in both ASCII and
92
Unicode: `[`, `\`, `]`, `^`, `_`, and <tt>\`</tt>.
93
94
* You may include a literal `-` in a list by placing it last, just
95
before the `]`.
96
97
* You may include a literal `]` in a list by making the first
98
character after the `[` or `[^`. At any other place, `]` ends the list.
99
100
* You may include a literal `^` in a list by placing it anywhere
101
except after the opening `[`.
102
103
* Beware that a range must be specified from low value to high
104
value: `[z-a]` does not match any character at all, preventing the
105
entire glob from matching.
106
107
Some examples of character lists:
108
109
:Pattern |:Effect
110
---------------------------------------------------------------------
111
`[a-d]` | Matches any one of `a`, `b`, `c`, or `d` but not `ä`
112
`[^a-d]` | Matches exactly one character other than `a`, `b`, `c`, or `d`
113
`[0-9a-fA-F]` | Matches exactly one hexadecimal digit
114
`[a-]` | Matches either `a` or `-`
115
`[][]` | Matches either `]` or `[`
116
`[^]]` | Matches exactly one character other than `]`
117
`[]^]` | Matches either `]` or `^`
118
`[^-]` | Matches exactly one character other than `-`
119
120
White space means the specific ASCII characters TAB, LF, VT, FF, CR,
121
and SPACE. Note that this does not include any of the many additional
122
spacing characters available in Unicode such as
123
U+00A0, NO-BREAK SPACE.
124
125
Because both LF and CR are white space and leading and trailing spaces
126
are stripped from each glob in a list, a list of globs may be broken
127
into lines between globs when the list is stored in a file, as for a
128
versioned setting.
129
130
Note that 'single quotes' and "double quotes" are the ASCII straight
131
quote characters, not any of the other quotation marks provided in
132
Unicode and specifically not the "curly" quotes preferred by
133
typesetters and word processors.
134
135
136
## File Names to Match
137
138
Before it is compared to a glob pattern, each file name is transformed
139
to a canonical form:
140
141
* all directory separators are changed to `/`
142
* redundant slashes are removed
143
* all `.` path components are removed
144
* all `..` path components are resolved
145
146
(There are additional details we are ignoring here, but they cover rare
147
edge cases and follow the principle of least surprise.)
148
149
The glob must match the *entire* canonical file name to be considered a
150
match.
151
152
The goal is to have a name that is the simplest possible for each
153
particular file, and that will be the same regardless of the platform
154
you run Fossil on. This is important when you have a repository cloned
155
from multiple platforms and have globs in versioned settings: you want
156
those settings to be interpreted the same way everywhere.
157
158
Beware, however, that all glob matching in Fossil is case sensitive
159
regardless of host platform and file system. This will not be a surprise
160
on POSIX platforms where file names are usually treated case
161
sensitively. However, most Windows file systems are case preserving but
162
case insensitive. That is, on Windows, the names `ReadMe` and `README`
163
are usually names of the same file. The same is true in other cases,
164
such as by default on macOS file systems and in the file system drivers
165
for Windows file systems running on non-Windows systems. (e.g. exfat on
166
Linux.) Therefore, write your Fossil glob patterns to match the name of
167
the file as checked into the repository.
168
169
Some example cases:
170
171
:Pattern |:Effect
172
--------------------------------------------------------------------------------
173
`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.
174
`*/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.
175
`*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`.
176
`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.
177
`*.[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.
178
179
180
## Where Globs are Used
181
182
### <a id="settings"></a>Settings that are Globs
183
184
These settings are all lists of glob patterns:
185
186
:Setting |:Description
187
--------------------------------------------------------------------------------
188
`binary-glob` | Files that should be treated as binary files for committing and merging purposes
189
`clean-glob` | Files that the [`clean`][] command will delete without prompting or allowing undo
190
`crlf-glob` | Files in which it is okay to have `CR`, `CR`+`LF` or mixed line endings. Set to "`*`" to disable CR+LF checking
191
`crnl-glob` | Alias for the `crlf-glob` setting
192
`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
193
`ignore-glob` | Files that the [`add`][], [`addremove`][], [`clean`][], and [`extras`][] commands will ignore
194
`keep-glob` | Files that the [`clean`][] command will keep
195
196
All may be [versioned, local, or global](settings.wiki). Use `fossil
197
settings` to manage local and global settings, or a file in the
198
repository's `.fossil-settings/` folder at the root of the tree named
199
for each for versioned setting.
200
201
Using versioned settings for these not only has the advantage that
202
they are tracked in the repository just like the rest of your project,
203
but you can more easily keep longer lists of more complicated glob
204
patterns than would be practical in either local or global settings.
205
206
The `ignore-glob` is an example of one setting that frequently grows
207
to be an elaborate list of files that should be ignored by most
208
commands. This is especially true when one (or more) IDEs are used in
209
a project because each IDE has its own ideas of how and where to cache
210
information that speeds up its browsing and building tasks but which
211
need not be preserved in your project's history.
212
213
Although the `empty-dirs` setting is not a list of glob patterns as
214
such, it is *parsed* that way for consistency among the settings,
215
allowing [the list parsing rules above](#syntax) to apply.
216
217
218
### <a id="commands"></a>Commands that Refer to Globs
219
220
Many of the commands that respect the settings containing globs have
221
options to override some or all of the settings. These options are
222
usually named to correspond to the setting they override, such as
223
`--ignore` to override the `ignore-glob` setting. These commands are:
224
225
* [`add`][]
226
* [`addremove`][]
227
* [`changes`][]
228
* [`clean`][]
229
* [`commit`][]
230
* [`extras`][]
231
* [`merge`][]
232
* [`settings`][]
233
* [`status`][]
234
* [`touch`][]
235
* [`unset`][]
236
237
The commands [`tarball`][] and [`zip`][] produce compressed archives of a
238
specific checkin. They may be further restricted by options that
239
specify glob patterns that name files to include or exclude rather
240
than archiving the entire checkin.
241
242
The commands [`http`][], [`cgi`][], [`server`][], and [`ui`][] that
243
implement or support with web servers provide a mechanism to name some
244
files to serve with static content where a list of glob patterns
245
specifies what content may be served.
246
247
[`add`]: /help/add
248
[`addremove`]: /help/addremove
249
[`changes`]: /help/changes
250
[`clean`]: /help/clean
251
[`commit`]: /help/commit
252
[`extras`]: /help/extras
253
[`merge`]: /help/merge
254
[`settings`]: /help/settings
255
[`status`]: /help/status
256
[`touch`]: /help/touch
257
[`unset`]: /help/unset
258
259
[`tarball`]: /help/tarball
260
[`zip`]: /help/zip
261
262
[`http`]: /help/http
263
[`cgi`]: /help/cgi
264
[`server`]: /help/server
265
[`ui`]: /help/ui
266
267
268
### Web Pages that Refer to Globs
269
270
The [`/timeline`][] page supports the query parameter `chng=GLOBLIST` that
271
names a list of glob patterns defining which files to focus the
272
timeline on. It also has the query parameters `t=TAG` and `r=TAG` that
273
names a tag to focus on, which can be configured with `ms=STYLE` to
274
use a glob pattern to match tag names instead of the default exact
275
match or a couple of other comparison styles.
276
277
The pages [`/tarball`][] and [`/zip`][] generate compressed archives
278
of a specific checkin. They may be further restricted by query
279
parameters that specify glob patterns that name files to include or
280
exclude rather than taking the entire checkin.
281
282
[`/timeline`]: /help/www/timeline
283
[`/tarball`]: /help/www/tarball
284
[`/zip`]: /help/www/zip
285
286
287
## Platform Quirks
288
289
Fossil glob patterns are based on the glob pattern feature of POSIX
290
shells. Fossil glob patterns also have a quoting mechanism, discussed
291
[above](#syntax). Because other parts of your operating system may interpret glob
292
patterns and quotes separately from Fossil, it is often difficult to
293
give glob patterns correctly to Fossil on the command line. Quotes and
294
special characters in glob patterns are likely to be interpreted when
295
given as part of a `fossil` command, causing unexpected behavior.
296
297
These problems do not affect [versioned settings files](settings.wiki)
298
or Admin &rarr; Settings in Fossil UI. Consequently, it is better to
299
set long-term `*-glob` settings via these methods than to use `fossil
300
settings` commands.
301
302
That advice does not help you when you are giving one-off glob patterns
303
in `fossil` commands. The remainder of this section gives remedies and
304
workarounds for these problems.
305
306
307
### <a id="posix"></a>POSIX Systems
308
309
If you are using Fossil on a system with a POSIX-compatible shell
310
&mdash; Linux, macOS, the BSDs, Unix, Cygwin, WSL etc. &mdash; the shell
311
may expand the glob patterns before passing the result to the `fossil`
312
executable.
313
314
Sometimes this is exactly what you want. Consider this command for
315
example:
316
317
$ fossil add RE*
318
319
If you give that command in a directory containing `README.txt` and
320
`RELEASE-NOTES.txt`, the shell will expand the command to:
321
322
$ fossil add README.txt RELEASE-NOTES.txt
323
324
…which is compatible with the `fossil add` command's argument list,
325
which allows multiple files.
326
327
Now consider what happens instead if you say:
328
329
$ fossil add --ignore RE* src/*.c
330
331
This *does not* do what you want because the shell will expand both `RE*`
332
and `src/*.c`, causing one of the two files matching the `RE*` glob
333
pattern to be ignored and the other to be added to the repository. You
334
need to say this in that case:
335
336
$ fossil add --ignore 'RE*' src/*.c
337
338
The single quotes force a POSIX shell to pass the `RE*` glob pattern
339
through to Fossil untouched, which will do its own glob pattern
340
matching. There are other methods of quoting a glob pattern or escaping
341
its special characters; see your shell's manual.
342
343
Beware that Fossil's `--ignore` option does not override explicit file
344
mentions:
345
346
$ fossil add --ignore 'REALLY SECRET STUFF.txt' RE*
347
348
You might think that would add everything beginning with `RE` *except*
349
for `REALLY SECRET STUFF.txt`, but when a file is both given
350
explicitly to Fossil and also matches an ignore rule, Fossil asks what
351
you want to do with it in the default case; and it does not even ask
352
if you gave the `-f` or `--force` option along with `--ignore`.
353
354
The spaces in the ignored file name above bring us to another point:
355
such file names must be quoted in Fossil glob patterns, lest Fossil
356
interpret it as multiple glob patterns, but the shell interprets
357
quotation marks itself.
358
359
One way to fix both this and the previous problem is:
360
361
$ fossil add --ignore "'REALLY SECRET STUFF.txt'" READ*
362
363
The nested quotation marks cause the inner set to be passed through to
364
Fossil, and the more specific glob pattern at the end &mdash; that is,
365
`READ*` vs `RE*` &mdash; avoids a conflict between explicitly-listed
366
files and `--ignore` rules in the `fossil add` command.
367
368
Another solution would be to use shell escaping instead of nested
369
quoting:
370
371
$ fossil add --ignore "\"REALLY SECRET STUFF.txt\"" READ*
372
373
It bears repeating that the two glob patterns here are not interpreted
374
the same way when running this command from a *subdirectory* of the top
375
checkout directory as when running it at the top of the checkout tree.
376
If these files were in a subdirectory of the checkout tree called `doc`
377
and that was your current working directory, the command would instead
378
have to be:
379
380
$ fossil add --ignore "'doc/REALLY SECRET STUFF.txt'" READ*
381
382
The Fossil glob pattern still needs the `doc/` prefix because
383
Fossil always interprets glob patterns from the base of the checkout
384
directory, not from the current working directory as POSIX shells do.
385
386
When in doubt, use `fossil status` after running commands like the
387
above to make sure the right set of files were scheduled for insertion
388
into the repository before checking the changes in. You never want to
389
accidentally check something like a password, an API key, or the
390
private half of a public cryptographic key into Fossil repository that
391
can be read by people who should not have such secrets.
392
393
394
### <a id="windows"></a>Windows
395
396
Before we get into Windows-specific details here, beware that this
397
section does not apply to the several Microsoft Windows extensions that
398
provide POSIX semantics to Windows, for which you want to use the advice
399
in [the POSIX section above](#posix) instead:
400
401
* the ancient and rarely-used [Microsoft POSIX subsystem][mps];
402
* its now-discontinued replacement feature, [Services for Unix][sfu]; or
403
* their modern replacement, the [Windows Subsystem for Linux][wsl]
404
405
[mps]: https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem
406
[sfu]: https://en.wikipedia.org/wiki/Windows_Services_for_UNIX
407
[wsl]: https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux
408
409
(The latter is sometimes incorrectly called "Bash on Windows" or "Ubuntu
410
on Windows," but the feature provides much more than just Bash or Ubuntu
411
for Windows.)
412
413
Neither standard Windows command shell &mdash; `cmd.exe` or PowerShell
414
&mdash; expands glob patterns the way POSIX shells do. Windows command
415
shells rely on the command itself to do the glob pattern expansion. The
416
way this works depends on several factors:
417
418
* the version of Windows you are using
419
* which OS upgrades have been applied to it
420
* the compiler that built your Fossil executable
421
* whether you are running the command interactively
422
* whether the command is built against a runtime system that does this
423
at all
424
* whether the Fossil command is being run from a file named `*.BAT` vs
425
being named `*.CMD`
426
427
Usually (but not always!) the C runtime library that your `fossil.exe`
428
executable is built against does this glob expansion on Windows so the
429
program proper does not have to. This may then interact with the way the
430
Windows command shell you’re using handles argument quoting. Because of
431
these differences, it is common to find perfectly valid Fossil command
432
examples that were written and tested on a POSIX system which then fail
433
when tried on Windows.
434
435
The most common problem is figuring out how to get a glob pattern passed
436
on the command line into `fossil.exe` without it being expanded by the C
437
runtime library that your particular Fossil executable is linked to,
438
which tries to act like [the POSIX systems described above](#posix). Windows is
439
not strongly governed by POSIX, so it has not historically hewed closely
440
to its strictures.
441
442
For example, consider how you would set `crlf-glob` to `*` in order to
443
get normal Windows text files with CR+LF line endings past Fossil's
444
"looks like a binary file" check. The na&iuml;ve approach will not work:
445
446
C:\...> fossil setting crlf-glob *
447
448
The C runtime library will expand that to the list of all files in the
449
current directory, which will probably cause a Fossil error because
450
Fossil expects either nothing or option flags after the setting's new
451
value, not a list of file names. (To be fair, the same thing will happen
452
on POSIX systems, only at the shell level, before `.../bin/fossil` even
453
gets run by the shell.)
454
455
Let's try again:
456
457
C:\...> fossil setting crlf-glob '*'
458
459
Quoting the argument like that will work reliably on POSIX, but it may
460
or may not work on Windows. If your Windows command shell interprets the
461
quotes, it means `fossil.exe` will see only the bare `*` so the C
462
runtime library it is linked to will likely expand the list of files in
463
the current directory before the `setting` command gets a chance to
464
parse the command line arguments, causing the same failure as above.
465
This alternative only works if you’re using a Windows command shell that
466
passes the quotes through to the executable *and* you have linked Fossil
467
to a C runtime library that interprets the quotes properly itself,
468
resulting in a bare `*` getting clear down to Fossil’s `setting` command
469
parser.
470
471
An approach that *will* work reliably is:
472
473
C:\...> echo * | fossil setting crlf-glob --args -
474
475
This works because the built-in Windows command `echo` does not expand its
476
arguments, and the `--args -` option makes Fossil read further command
477
arguments from its standard input, which is connected to the output
478
of `echo` by the pipe. (`-` is a common Unix convention meaning
479
"standard input," which Fossil obeys.) A [batch script][fng.cmd] to automate this trick was
480
posted on the now-inactive Fossil Mailing List.
481
482
[fng.cmd]: https://www.mail-archive.com/[email protected]/msg25099.html
483
484
(Ironically, this method will *not* work on POSIX systems because it is
485
not up to the command to expand globs. The shell will expand the `*` in
486
the `echo` command, so the list of file names will be passed to the
487
`fossil` standard input, just as with the first example above!)
488
489
Another (usually) correct approach which will work on both Windows and
490
POSIX systems:
491
492
C:\...> fossil setting crlf-glob *,
493
494
This works because the trailing comma prevents the glob pattern from
495
matching any files, unless you happen to have files named with a
496
trailing comma in the current directory. If the pattern matches no
497
files, it is passed into Fossil's `main()` function as-is by the C
498
runtime system. Since Fossil uses commas to separate multiple glob
499
patterns, this means "all files from the root of the Fossil checkout
500
directory downward and nothing else," which is of course equivalent to
501
"all managed files in this repository," our original goal.
502
503
504
## Experimenting
505
506
To preview the effects of command line glob pattern expansion for
507
various glob patterns (unquoted, quoted, comma-terminated), for any
508
combination of command shell, OS, C run time, and Fossil version,
509
precede the command you want to test with [`test-echo`][] like so:
510
511
$ fossil test-echo setting crlf-glob "*"
512
C:\> echo * | fossil test-echo setting crlf-glob --args -
513
514
The [`test-glob`][] command is also handy to test if a string
515
matches a glob pattern.
516
517
[`test-echo`]: /help/test-echo
518
[`test-glob`]: /help/test-glob
519
520
521
## Converting `.gitignore` to `ignore-glob`
522
523
Many other version control systems handle the specific case of
524
ignoring certain files differently from Fossil: they have you create
525
individual "ignore" files in each folder, which specify things ignored
526
in that folder and below. Usually some form of glob patterns are used
527
in those files, but the details differ from Fossil.
528
529
In many simple cases, you can just store a top level "ignore" file in
530
`.fossil-settings/ignore-glob`. But as usual, there will be lots of
531
edge cases.
532
533
[Git has a rich collection of ignore files][gitignore] which
534
accumulate rules that affect the current command. There are global
535
files, per-user files, per workspace unmanaged files, and fully
536
version controlled files. Some of the files used have no set name, but
537
are called out in configuration files.
538
539
[gitignore]: https://git-scm.com/docs/gitignore
540
541
In contrast, Fossil has a global setting and a local setting, but the local setting
542
overrides the global rather than extending it. Similarly, a Fossil
543
command's `--ignore` option replaces the `ignore-glob` setting rather
544
than extending it.
545
546
With that in mind, translating a `.gitignore` file into
547
`.fossil-settings/ignore-glob` may be possible in many cases. Here are
548
some of features of `.gitignore` and comments on how they relate to
549
Fossil:
550
551
* "A blank line matches no files...": same in Fossil.
552
* "A line starting with # serves as a comment...": same in Fossil, including
553
the possibility of escaping an initial `#` with a backslash to allow globs
554
beginning with a hash.
555
* "Trailing spaces are ignored unless they are quoted..." is similar
556
in Fossil. All whitespace before and after a glob is trimmed in
557
Fossil unless quoted with single or double quotes. Git uses
558
backslash quoting instead, which Fossil does not.
559
* "An optional prefix "!" which negates the pattern...": not in
560
Fossil.
561
* Git's globs are relative to the location of the `.gitignore` file:
562
Fossil's globs are relative to the root of the workspace.
563
* Git's globs and Fossil's globs treat directory separators
564
differently. Git includes a notation for zero or more directories
565
that is not needed in Fossil.
566
567
### Example
568
569
In a project with source and documentation:
570
571
work
572
+-- doc
573
+-- src
574
575
The file `doc/.gitignore` might contain:
576
577
# Finished documents by pandoc via LaTeX
578
*.pdf
579
# Intermediate files
580
*.tex
581
*.toc
582
*.log
583
*.out
584
*.tmp
585
586
Entries in `.fossil-settings/ignore-glob` with similar effect, also
587
limited to the `doc` folder:
588
589
doc/*.pdf
590
doc/*.tex, doc/*.toc, doc/*.log, doc/*.out, doc/*.tmp
591
592
593
594
595
596
## Implementation and References
597
598
The implementation of the Fossil-specific glob pattern handling is here:
599
600
:File |:Description
601
--------------------------------------------------------------------------------
602
[`src/glob.c`][] | pattern list loading, parsing, and generic matching code
603
[`src/file.c`][] | application of glob patterns to file names
604
605
[`src/glob.c`]: https://fossil-scm.org/home/file/src/glob.c
606
[`src/file.c`]: https://fossil-scm.org/home/file/src/file.c
607
608
See the [Adding Features to Fossil][aff] document for broader details
609
about finding and working with such code.
610
611
The actual pattern matching leverages the `GLOB` operator in SQLite, so
612
you may find [its documentation][gdoc], [source code][gsrc] and [test
613
harness][gtst] helpful.
614
615
[aff]: ./adding_code.wiki
616
[gdoc]: https://sqlite.org/lang_expr.html#like
617
[gsrc]: https://www.sqlite.org/src/artifact?name=9d52522cc8ae7f5c&ln=570-768
618
[gtst]: https://www.sqlite.org/src/artifact?name=66a2c9ac34f74f03&ln=586-673
619

Keyboard Shortcuts

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