Fossil Forum

settings don't work for sub-directories
Login

settings don't work for sub-directories

settings don't work for sub-directories

(1.1) By Doug (doug9forester) on 2022-02-25 21:18:21 edited from 1.0 [source]

Using: $ fossil version This is fossil version 2.18 [f96e9dfad3] 2021-11-22 16:12:43 UTC

If you set crlf-glob (via ui/admin/settings) to include "*.ini[,]", and you have a file in a sub-directory (eg aa/yy.ini), the setting is not observed on check-in.

Also if you set the ignore-glob to include "*/*.bak", Fossil will ignore any extras in any subdirectory whether it is named .bak or not. If I use "aaa/*.bak", those files name *.bak in directory aaa are ignored correctly.

(2) By Stephan Beal (stephan) on 2022-02-25 21:42:16 in reply to 1.1 [link] [source]

If you set crlf-glob (via ui/admin/settings) to include "*.ini[,]", and you have a file in a sub-directory (eg aa/yy.ini), the setting is not observed on check-in.

That glob does not match that filename: your glob has a trailing comma. The [,] part (as you probably know but some readers may not) treats the comma as part of the regex, rather than a separator for the glob list (which can be either newline- or comma-delimited).

Also if you set the ignore-glob to include "*/*.bak", Fossil will ignore any extras in any subdirectory whether it is named .bak or not. If I use "aaa/*.bak", those files name *.bak in directory aaa are ignored correctly.

If you can provide a repository which demonstrates this we can certainly either resolve any buggy behavior or explain non-buggy-but-non-intuitive behavior.

An example of non-intuitive behavior: fossil's globs are not subdirectory-aware like some glob APIs are. For them the filename, including any directory prefix, is "just a string" and any / characters are not treated specially. Thus if you have directories named *.bak, a glob of *.bak will not match files in those directories: you'd need *.bak/*.

(3) By Doug (doug9forester) on 2022-02-26 00:45:47 in reply to 2 [link] [source]

My confusing stemmed from the words "file name" in the description for the glob settings. It didn't occur to me that your definition of "file name" includes the relative path name (with '/'s). I was treating them as separate entities.

It would be helpful to include a sentence to that effect at the start of document named "File Name Glob Patterns". Something like:

The term "file name" in this document includes any directory prefix in the name.

(4) By Stephan Beal (stephan) on 2022-02-26 01:40:48 in reply to 3 [link] [source]

It would be helpful to include a sentence to that effect at the start of document named "File Name Glob Patterns".

Done. FWIW, you're not the first person to trip over that peculiarity of fossil's globbing. Presumably it originates from the globbing code having been inherited from sqlite, where it's used in a more general-purpose way than globbing filenames.