Age | Commit message (Collapse) | Author |
|
The library may be provided with a new-line separated list of regular expressions via the newly introduced `CHANGE_LOG_IGNORE_PATTERN_PATH`.
Any proposed tracking path that is matched by any of the provided patterns is excluded from change reporting. This functionality uses the Standard's regular expression parsing functionality and as such doesn't introduce any new dependencies. If no file path is provided or the provided file path is unreadable all paths will be tracked.
`change` was adapted to set `CHANGE_LOG_IGNORE_PATTERN_PATH` to `.change_log_ignore` which means that it will by default exclude any patterns provided via this file in the current working directory.
An example for such a file customized for hiding _vim_'s internal write
logic may look as follows:
[0-9]+
[^~]*~
[.*\.viminfo
.*\.swp
Note that this is implemented in a fashion where it is not guaranteed that the full _canonical_ path is checked against the patterns. It remains to be decided if this is enough for all common use cases of this new functionality.
`tracking::PathMatcher` lacks any explicit thread synchronization - according to my current knowledge this should not be necessary as we are only ever reading the private `std::vector<std::regex>` instance.
If invalid regular expressions are provided they are silently ignored.
|
|
|
|
|
|
|
|
|
|
Relying on `diff` for storing the pre-change content did not work out as it opens the file descriptors to soon and only reads the first block of pre-change file content until the remaining content is actually required. This obviously led to problems when tracking actually changing files.
|
|
This obviously leads to synchronizing syscalls that would otherwise happen in parallel. Luckily the goal of this library is to monitor file changes performed by single, user facing applications and as such it doesn't matter if some operations are slightly slower.
|
|
|
|
|
|
Prevents the same file being tracked multiple times due to relative input paths.
|
|
While the file arguments remain fixed the actual `diff` application and its output style can be changed using the `CHANGE_LOG_DIFF_CMD` environment variable.
|
|
|