<feed xmlns='http://www.w3.org/2005/Atom'>
<title>change/src/tracking, branch master</title>
<subtitle>Transparent fs change tracking based on function interposition</subtitle>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/'/>
<entry>
<title>Rename `PathMatcher::isMatching` to `PathMatcher::is_matching`</title>
<updated>2016-02-22T19:46:27+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-22T19:46:27+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=f357d79176ffbde8947a8c9b039729273f7411cd'/>
<id>f357d79176ffbde8947a8c9b039729273f7411cd</id>
<content type='text'>
Purely cosmetic change to match the overall naming scheme.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purely cosmetic change to match the overall naming scheme.
</pre>
</div>
</content>
</entry>
<entry>
<title>Interpose `open` library function</title>
<updated>2016-02-20T21:30:11+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-20T21:30:11+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=b3ef0fc8daa41e433f1919a4933a1cc047f59341'/>
<id>b3ef0fc8daa41e433f1919a4933a1cc047f59341</id>
<content type='text'>
`open` is not as side effect free as I had imagined - i.e. if the flag `O_TRUNC` is passed it truncates the file contents alongside opening the file descriptor. In practice this is done by _emacs_ prior to writing the new file content and as such needs to be intercepted so we can start tracking the file before it is changed.

Interposing `open` required some changes to make the library work without including `fcntl.h`. This header not only defines some of the flags we require to check if a library call actually is able to change files but also defines the `open` library function.

While implementing this change I noticed that the function interpositions implemented in C++ actually need to be declared as `external "C"` so their names do not get wrangled during compilation. I suspect that this was previously implicitly done for e.g. `mmap` and `write` by the included C standard library headers. However this did not work for `open` which is why all function interpositions are now explicitly declared external.

End result: _emacs_ file changes are now tracked correctly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`open` is not as side effect free as I had imagined - i.e. if the flag `O_TRUNC` is passed it truncates the file contents alongside opening the file descriptor. In practice this is done by _emacs_ prior to writing the new file content and as such needs to be intercepted so we can start tracking the file before it is changed.

Interposing `open` required some changes to make the library work without including `fcntl.h`. This header not only defines some of the flags we require to check if a library call actually is able to change files but also defines the `open` library function.

While implementing this change I noticed that the function interpositions implemented in C++ actually need to be declared as `external "C"` so their names do not get wrangled during compilation. I suspect that this was previously implicitly done for e.g. `mmap` and `write` by the included C standard library headers. However this did not work for `open` which is why all function interpositions are now explicitly declared external.

End result: _emacs_ file changes are now tracked correctly.
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename some functions to match overall naming scheme</title>
<updated>2016-02-19T18:11:33+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-19T18:11:33+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=5021c97e31ef8bb7cf40471e3fa98b451097451b'/>
<id>5021c97e31ef8bb7cf40471e3fa98b451097451b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for commenting ignore patterns file</title>
<updated>2016-02-15T17:01:39+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-15T17:01:39+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=0e6a00561cc7997ebb382f96d296bc84725ed91d'/>
<id>0e6a00561cc7997ebb382f96d296bc84725ed91d</id>
<content type='text'>
All lines starting with `#` are interpreted as comments
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All lines starting with `#` are interpreted as comments
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement support for excluding arbitrary paths from tracking</title>
<updated>2016-02-14T19:52:29+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-14T19:52:29+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=1ffaf37388cd691e88196b6e00455eda0e652cf0'/>
<id>1ffaf37388cd691e88196b6e00455eda0e652cf0</id>
<content type='text'>
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&lt;std::regex&gt;` instance.
If invalid regular expressions are provided they are silently ignored.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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&lt;std::regex&gt;` instance.
If invalid regular expressions are provided they are silently ignored.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reduce `ChangeTracker` public _interface_ to `track`</title>
<updated>2016-02-14T12:31:59+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-14T12:31:59+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=f8eecef184c8684a3ed27712ccf8f7f866d47c40'/>
<id>f8eecef184c8684a3ed27712ccf8f7f866d47c40</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add filesystem exception handling where required</title>
<updated>2016-02-13T19:56:05+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-13T19:56:05+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=23b56fad3873b03a4b1f04e299104a7b52c62391'/>
<id>23b56fad3873b03a4b1f04e299104a7b52c62391</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Extract child emplacement into thread safe member</title>
<updated>2016-02-11T12:57:27+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-11T12:57:27+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=5ea3620b2fb39ee9408d93fd6cd214d557d42a7f'/>
<id>5ea3620b2fb39ee9408d93fd6cd214d557d42a7f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent deleted files from being displayed using `diff`</title>
<updated>2016-02-06T22:33:47+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-06T22:33:47+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=bfa7c9e7ea1f818482a4205a500e87fb9d8a8ec3'/>
<id>bfa7c9e7ea1f818482a4205a500e87fb9d8a8ec3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Preserve pre-change file content as tracking state</title>
<updated>2016-02-06T21:20:46+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2016-02-06T21:20:46+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=f08930c9c9ce91007c2f576c25d3f874abb96a00'/>
<id>f08930c9c9ce91007c2f576c25d3f874abb96a00</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce thread synchronization for tracking init and logging</title>
<updated>2015-12-27T09:07:24+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2015-12-27T09:07:24+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=0f083843bc31bf985991728125ef74efca6ef7b7'/>
<id>0f083843bc31bf985991728125ef74efca6ef7b7</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent the libraries own log writes from being tracked</title>
<updated>2015-12-24T13:04:21+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2015-12-24T13:04:21+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=c2af553b1c2de9fb158a70c5858d9c7fa527f9ee'/>
<id>c2af553b1c2de9fb158a70c5858d9c7fa527f9ee</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add path label for the file provided via standard input</title>
<updated>2015-12-24T09:38:42+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2015-12-24T09:38:42+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=a8157a2acf5ac23e58aa18fe3ddf855341790d5f'/>
<id>a8157a2acf5ac23e58aa18fe3ddf855341790d5f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use full path for change tracking</title>
<updated>2015-12-24T09:28:20+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2015-12-24T09:28:20+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=50e1bb1a194c06ed0110bd13b5cca769a38c4157'/>
<id>50e1bb1a194c06ed0110bd13b5cca769a38c4157</id>
<content type='text'>
Prevents the same file being tracked multiple times due to relative input paths.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prevents the same file being tracked multiple times due to relative input paths.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for changing the `diff` command via an environment variable</title>
<updated>2015-12-23T23:37:32+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2015-12-23T23:37:32+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=ce1460dd98185f80db479c7dc7ca19026149a255'/>
<id>ce1460dd98185f80db479c7dc7ca19026149a255</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Match namespace and directory structure</title>
<updated>2015-12-23T23:11:06+00:00</updated>
<author>
<name>Adrian Kummerlaender</name>
</author>
<published>2015-12-23T23:11:06+00:00</published>
<link rel='alternate' type='text/html' href='https://code.kummerlaender.eu/change/commit/?id=baf30b7b83822b7d6efd0c16761b8e42a1e96101'/>
<id>baf30b7b83822b7d6efd0c16761b8e42a1e96101</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
