<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git, branch ethomson/poolinit</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>git_pool_init: handle failure cases</title>
<updated>2020-06-01T12:12:17+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-23T09:15:51+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=0f35efeb5722f950218e3649d7814a6a91b1c351'/>
<id>0f35efeb5722f950218e3649d7814a6a91b1c351</id>
<content type='text'>
Propagate failures caused by pool initialization errors.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Propagate failures caused by pool initialization errors.
</pre>
</div>
</content>
</entry>
<entry>
<title>git_pool_init: return an int</title>
<updated>2020-05-23T09:15:37+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-23T09:15:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=abfdb8a6d252a4834df9234ad338c97f1a4f97f2'/>
<id>abfdb8a6d252a4834df9234ad338c97f1a4f97f2</id>
<content type='text'>
Let `git_pool_init` return an int so that it could fail.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let `git_pool_init` return an int so that it could fail.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5515 from pks-t/pks/flaky-checkout-test</title>
<updated>2020-05-23T08:57:22+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-23T08:57:22+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=e4bdba5647d30a1cb0f5952bb857301e453a1ab1'/>
<id>e4bdba5647d30a1cb0f5952bb857301e453a1ab1</id>
<content type='text'>
tests: checkout: fix flaky test due to mtime race</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tests: checkout: fix flaky test due to mtime race</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5523 from libgit2/pks/cmake-sort-reproducible-builds</title>
<updated>2020-05-23T08:40:55+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-23T08:40:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=3b7b4d27130c4ef906d3ef6f51991bb7e46ac0f4'/>
<id>3b7b4d27130c4ef906d3ef6f51991bb7e46ac0f4</id>
<content type='text'>
cmake: Sort source files for reproducible builds</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cmake: Sort source files for reproducible builds</pre>
</div>
</content>
</entry>
<entry>
<title>checkout::index: free the index</title>
<updated>2020-05-23T08:35:53+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-23T08:35:53+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=f88e12dbe3982ce9364754198d4cdea79ff575ae'/>
<id>f88e12dbe3982ce9364754198d4cdea79ff575ae</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>checkout: fix file being treated as unmodified due to racy index</title>
<updated>2020-05-16T12:02:42+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-05-16T11:48:04+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=3f201f75c6580743dfe557f99a196eed246df2bf'/>
<id>3f201f75c6580743dfe557f99a196eed246df2bf</id>
<content type='text'>
When trying to determine whether a file changed, we try to avoid heavy
operations by fist taking a look at the index, seeing whether the index
entry is modified already. This doesn't seem to cut it, though, as we
currently have the racy checkout::index::can_disable_pathspec_match test
case: sometimes the files get restored to their original contents,
sometimes they aren't.

The issue is caused by a racy index [1]: in case we modify a file, add
it to the index and then modify it again in-place without changing its
file, then we may end up with a modified file that has the same stat(3P)
info as we've currently got it in its corresponding index entry. The
mitigation for this is to treat files with the same mtime as the index
are treated as racily modified. We already have this logic in place for
the index, but not when doing a checkout.

Fix the issue by only consulting the index entry in case it has an older
mtime as the index. Previously, the following script reliably had at
least 20 failures, while now there is no failure to be observed anymore:

```bash
j=0
for i in $(seq 100)
do
	if ! ./libgit2_clar -scheckout::index::can_disable_pathspec_match &gt;/dev/null
	then
		j=$(($j + 1))
	fi
done
echo "Failures: $j"
```

[1]: https://git-scm.com/docs/racy-git
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When trying to determine whether a file changed, we try to avoid heavy
operations by fist taking a look at the index, seeing whether the index
entry is modified already. This doesn't seem to cut it, though, as we
currently have the racy checkout::index::can_disable_pathspec_match test
case: sometimes the files get restored to their original contents,
sometimes they aren't.

The issue is caused by a racy index [1]: in case we modify a file, add
it to the index and then modify it again in-place without changing its
file, then we may end up with a modified file that has the same stat(3P)
info as we've currently got it in its corresponding index entry. The
mitigation for this is to treat files with the same mtime as the index
are treated as racily modified. We already have this logic in place for
the index, but not when doing a checkout.

Fix the issue by only consulting the index entry in case it has an older
mtime as the index. Previously, the following script reliably had at
least 20 failures, while now there is no failure to be observed anymore:

```bash
j=0
for i in $(seq 100)
do
	if ! ./libgit2_clar -scheckout::index::can_disable_pathspec_match &gt;/dev/null
	then
		j=$(($j + 1))
	fi
done
echo "Failures: $j"
```

[1]: https://git-scm.com/docs/racy-git
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: checkout: fix stylistic issues and static variable</title>
<updated>2020-05-16T12:02:42+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-05-16T12:00:11+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=915f88609a6685fbad1f5ad6fa7a5bb320f03138'/>
<id>915f88609a6685fbad1f5ad6fa7a5bb320f03138</id>
<content type='text'>
The test case checkout::index::can_disable_pathspec_match has some
shortcomings when it comes to coding style, which didn't fit our own
coding style. Furthermore, it had an unnecessary static local variable.

The test has been refactored to address these issues.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test case checkout::index::can_disable_pathspec_match has some
shortcomings when it comes to coding style, which didn't fit our own
coding style. Furthermore, it had an unnecessary static local variable.

The test has been refactored to address these issues.
</pre>
</div>
</content>
</entry>
<entry>
<title>cmake: Sort source files for reproducible builds</title>
<updated>2020-05-15T17:57:09+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-05-15T17:52:40+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=b85eefb4604d3ca6983bf80e7dc9d1cedde072fd'/>
<id>b85eefb4604d3ca6983bf80e7dc9d1cedde072fd</id>
<content type='text'>
We currently use `FILE(GLOB ...)` in most places to find source and
header files. This is problematic in that the order of files returned
depends on the operating system's directory iteration order and may thus
not be deterministic. As a result, we link object files in unspecified
order, which may cause the linker to emit different code across runs.

Fix this issue by sorting all code used as input to the libgit2 library
to improve the reliability of reproducible builds.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We currently use `FILE(GLOB ...)` in most places to find source and
header files. This is problematic in that the order of files returned
depends on the operating system's directory iteration order and may thus
not be deterministic. As a result, we link object files in unspecified
order, which may cause the linker to emit different code across runs.

Fix this issue by sorting all code used as input to the libgit2 library
to improve the reliability of reproducible builds.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #5517 from libgit2/pks/futils-symlink-args</title>
<updated>2020-05-12T21:39:27+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-12T21:39:27+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=b7b872f51074ef8231ae8b94dd93eada127c9365'/>
<id>b7b872f51074ef8231ae8b94dd93eada127c9365</id>
<content type='text'>
futils: fix order of declared parameters for `git_futils_fake_symlink`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
futils: fix order of declared parameters for `git_futils_fake_symlink`</pre>
</div>
</content>
</entry>
<entry>
<title>futils: fix order of declared parameters for `git_futils_fake_symlink`</title>
<updated>2020-05-12T19:37:18+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-05-12T19:35:07+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/libgit2.git/commit/?id=a2eca682825523df8a03119ccd319519b52d341f'/>
<id>a2eca682825523df8a03119ccd319519b52d341f</id>
<content type='text'>
While the function `git_futils_fake_symlink` is declared with arguments
`new, old`, the implementation uses the reverse order `old, new`. Let's
fix the ordering issues to be `new, old` for both, which matches what
symlink(3P) has. While at it, we also rename these parameters: `old` and
`new` doesn't really make a lot of sense in the context of symlinks,
which is why this commit renames them to be called `target` and `path`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While the function `git_futils_fake_symlink` is declared with arguments
`new, old`, the implementation uses the reverse order `old, new`. Let's
fix the ordering issues to be `new, old` for both, which matches what
symlink(3P) has. While at it, we also rename these parameters: `old` and
`new` doesn't really make a lot of sense in the context of symlinks,
which is why this commit renames them to be called `target` and `path`.
</pre>
</div>
</content>
</entry>
</feed>
