Fossil

Check-in [a53d3b7d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Assorted tweaks to new Platform Quirks section of www/globs.md after re-reading it.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | glob-docs
Files: files | file ages | folders
SHA3-256:a53d3b7db1339714df52c8874473f3f57c22c797d59163a080b02516ace42a49
User & Date: wyoung 2017-05-01 13:57:29
Context
2017-05-04
14:52
Tweak format of initial list of special characters to match format of examples given two sections below check-in: 160b9852 user: andygoth tags: glob-docs
2017-05-01
13:57
Assorted tweaks to new Platform Quirks section of www/globs.md after re-reading it. check-in: a53d3b7d user: wyoung tags: glob-docs
13:34
Replaced the Platform Quirks section of the www/globs.md document with a modified version of what I (Warren Young) posted to the mailing list, the differences answering Ross Berteig critiques of the original version. check-in: 0a51f1bf user: wyoung tags: glob-docs
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to www/globs.md.

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
...
302
303
304
305
306
307
308
309
310
311
312
313
314
315

316

317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
...
384
385
386
387
388
389
390
391

392
393
394
395
396
397
398
399
## Platform Quirks

Fossil glob patterns are based on the glob pattern feature of POSIX
shells. Fossil glob patterns also have a quoting mechanism, discussed
above. Because other parts of your operating system may interpret glob
patterns and quotes separately from Fossil, it is often difficult to
give glob patterns correctly to Fossil on the command line. Quotes and
special characters in glob patterns are likely to interpreted when given
as part of a `fossil` command, causing unexpected behavior.

These problems do not affect [versioned settings
files](/doc/trunk/www/settings.wiki) or Admin → Settings in Fossil
UI. Consequently, it is better to set long-term `*-glob` settings via
these methods than to use `fossil settings` commands.

That advice doesn't help you when you are giving one-off glob patterns
................................................................................

Beware that Fossil's `--ignore` option doesn't override explicit file
mentions:

    $ fossil add --ignore 'REALLY SECRET STUFF.txt' RE*

You might think that would add everything beginning with `RE` *except*
for `REALLY SECRET STUFF.txt`, but Fossil when a file is given
explicitly and found in the ignore list, Fossil asks what you want to do
with it in the default case, and doesn't even ask if gave `-f` or
`--force` along with `--ignore`.

The spaces in the ignored file name above bring us to another point:
file names must be quoted in Fossil glob patterns, but the shell

interprets quotation marks itself. There are a couple of ways to fix

both this and the previous problem:

    $ fossil add --ignore "'REALLY SECRET STUFF.txt'" READ*

The nested quotation marks cause the inner set to be passed through to
Fossil, and the more specific glob pattern expanded by the shell (that
is, `READ*` vs `RE*`) avoids a conflict between explicitly-listed files
and `--ignore` rules in the `fossil add` command.

Another solution would be to use shell escaping instead of nested
quoting:

    $ fossil add --ignore "\"REALLY SECRET STUFF.txt\"" READ*

It bears repeating that the two glob patterns here are not interpreted
................................................................................
Windows' obsolete [Services for Unix
3.*x*](https://en.wikipedia.org/wiki/Windows_Services_for_UNIX) feature,
or the [Windows Subsystem for
Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux). (The
latter is sometimes incorrectly called "Bash on Windows" or "Ubuntu on
Windows.") See the POSIX Systems section above for those cases.)

For example, consider how you would set `crlf-glob` to `*`. The

naïve approach will not work:

    C:\...> fossil setting crlf-glob *

The C runtime library will expand that to the list of all files in the
current directory, which will probably cause a Fossil error because
Fossil expects either nothing or option flags after the setting's new
value.







|
|







 







|
|
|
|


|
>
|
>
|




|
|
|







 







|
>
|







247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
...
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
...
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
## Platform Quirks

Fossil glob patterns are based on the glob pattern feature of POSIX
shells. Fossil glob patterns also have a quoting mechanism, discussed
above. Because other parts of your operating system may interpret glob
patterns and quotes separately from Fossil, it is often difficult to
give glob patterns correctly to Fossil on the command line. Quotes and
special characters in glob patterns are likely to be interpreted when
given as part of a `fossil` command, causing unexpected behavior.

These problems do not affect [versioned settings
files](/doc/trunk/www/settings.wiki) or Admin → Settings in Fossil
UI. Consequently, it is better to set long-term `*-glob` settings via
these methods than to use `fossil settings` commands.

That advice doesn't help you when you are giving one-off glob patterns
................................................................................

Beware that Fossil's `--ignore` option doesn't override explicit file
mentions:

    $ fossil add --ignore 'REALLY SECRET STUFF.txt' RE*

You might think that would add everything beginning with `RE` *except*
for `REALLY SECRET STUFF.txt`, but when a file is both given explicitly
to Fossil and also matches an ignore rule, Fossil asks what you want to
do with it in the default case; it doesn't even ask if you gave the `-f`
or `--force` option along with `--ignore`.

The spaces in the ignored file name above bring us to another point:
such file names must be quoted in Fossil glob patterns, lest Fossil
interpret it as multiple glob patterns, but the shell interprets
quotation marks itself.

One way to fix both this and the previous problem is:

    $ fossil add --ignore "'REALLY SECRET STUFF.txt'" READ*

The nested quotation marks cause the inner set to be passed through to
Fossil, and the more specific glob pattern at the end — that is,
`READ*` vs `RE*` — avoids a conflict between explicitly-listed
files and `--ignore` rules in the `fossil add` command.

Another solution would be to use shell escaping instead of nested
quoting:

    $ fossil add --ignore "\"REALLY SECRET STUFF.txt\"" READ*

It bears repeating that the two glob patterns here are not interpreted
................................................................................
Windows' obsolete [Services for Unix
3.*x*](https://en.wikipedia.org/wiki/Windows_Services_for_UNIX) feature,
or the [Windows Subsystem for
Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux). (The
latter is sometimes incorrectly called "Bash on Windows" or "Ubuntu on
Windows.") See the POSIX Systems section above for those cases.)

For example, consider how you would set `crlf-glob` to `*` in order to
disable Fossil's "looks like a binary file" checks. The naïve
approach will not work:

    C:\...> fossil setting crlf-glob *

The C runtime library will expand that to the list of all files in the
current directory, which will probably cause a Fossil error because
Fossil expects either nothing or option flags after the setting's new
value.