<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git, branch ethomson/racy-diff</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>checkout: allow workdir to contain checkout target</title>
<updated>2015-06-16T21:23:12+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-06-16T21:23:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=892abf93157ea576fc3f2ccac118045a6a47247c'/>
<id>892abf93157ea576fc3f2ccac118045a6a47247c</id>
<content type='text'>
When checking out some file 'foo' that has been modified in the
working directory, allow the checkout to proceed (do not conflict)
if 'foo' is identical to the target of the checkout.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When checking out some file 'foo' that has been modified in the
working directory, allow the checkout to proceed (do not conflict)
if 'foo' is identical to the target of the checkout.
</pre>
</div>
</content>
</entry>
<entry>
<title>merge::workdir::dirty: tick idx to defeat racy-git</title>
<updated>2015-06-16T20:39:13+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-06-16T20:34:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=fef5344c50e33d01c08bec1687cb8a14a2a5efa2'/>
<id>fef5344c50e33d01c08bec1687cb8a14a2a5efa2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce p_utimes and p_futimes</title>
<updated>2015-06-16T19:32:02+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-06-16T19:18:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=121c3171e5b4918337910250487691efa8dbbd49'/>
<id>121c3171e5b4918337910250487691efa8dbbd49</id>
<content type='text'>
Provide functionality to set the time on a filesystem entry,
using utimes or futimes on POSIX type systems or SetFileTime
on Win32.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide functionality to set the time on a filesystem entry,
using utimes or futimes on POSIX type systems or SetFileTime
on Win32.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: tick the index when we count OID calculations</title>
<updated>2015-06-16T06:51:45+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-16T06:51:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=e44abe16bd20512c76331e6889f390e35993153a'/>
<id>e44abe16bd20512c76331e6889f390e35993153a</id>
<content type='text'>
These tests want to test that we don't recalculate entries which match
the index already. This is however something we force when truncating
racily-clean entries.

Tick the index forward as we know that we don't perform the
modifications which the racily-clean code is trying to avoid.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These tests want to test that we don't recalculate entries which match
the index already. This is however something we force when truncating
racily-clean entries.

Tick the index forward as we know that we don't perform the
modifications which the racily-clean code is trying to avoid.
</pre>
</div>
</content>
</entry>
<entry>
<title>crlf: tick the index forward to work around racy-git behaviour</title>
<updated>2015-06-16T06:40:45+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-15T12:32:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=c4e6ab5f23819c35dc0c1a0fd7f50e5a194f0d5a'/>
<id>c4e6ab5f23819c35dc0c1a0fd7f50e5a194f0d5a</id>
<content type='text'>
In order to avoid racy-git, we zero out the file size for entries with
the same timestamp as the index (or during the initial checkout). This
is the case in a couple of crlf tests, as the code is fast enough to do
everything in the same second.

As we know that we do not perform the modification just after writing
out the index, which is what this is designed to work around, tick the
mtime of the index file such that it doesn't agree with the files
anymore, and we do not zero out these entries.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to avoid racy-git, we zero out the file size for entries with
the same timestamp as the index (or during the initial checkout). This
is the case in a couple of crlf tests, as the code is fast enough to do
everything in the same second.

As we know that we do not perform the modification just after writing
out the index, which is what this is designed to work around, tick the
mtime of the index file such that it doesn't agree with the files
anymore, and we do not zero out these entries.
</pre>
</div>
</content>
</entry>
<entry>
<title>index: zero the size of racily-clean entries</title>
<updated>2015-06-16T06:40:45+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-15T07:55:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=316b820b6fed712d4b6fae886ba1e6c44afc6c81'/>
<id>316b820b6fed712d4b6fae886ba1e6c44afc6c81</id>
<content type='text'>
If a file entry has the same timestamp as the index itself, it is
considered racily-clean, as it may have been modified after the index
was written, but during the same second. We take extra steps to check
the contents, but this is just one part of avoiding races.

For files which do have changes but have not been updated in the index,
updating the on-disk index means updating its timestamp, which means we
would no longer recognise these entries as racy and we would trust the
timestamp to tell us whether they have changed.

In order to work around this, git zeroes out the file-size field in
entries with the same timestamp as the index in order to force the next
diff to check the contents. Do so in libgit2 as well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a file entry has the same timestamp as the index itself, it is
considered racily-clean, as it may have been modified after the index
was written, but during the same second. We take extra steps to check
the contents, but this is just one part of avoiding races.

For files which do have changes but have not been updated in the index,
updating the on-disk index means updating its timestamp, which means we
would no longer recognise these entries as racy and we would trust the
timestamp to tell us whether they have changed.

In order to work around this, git zeroes out the file-size field in
entries with the same timestamp as the index in order to force the next
diff to check the contents. Do so in libgit2 as well.
</pre>
</div>
</content>
</entry>
<entry>
<title>diff: add failing test for racy-git in the index</title>
<updated>2015-06-16T06:40:45+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-15T07:51:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=77596fcfd7cd14d0998b333af5f2d11ffea84843'/>
<id>77596fcfd7cd14d0998b333af5f2d11ffea84843</id>
<content type='text'>
We update the index and then immediately change the contents of the
file. This makes the diff think there are no changes, as the timestamp
of the file agrees with the cached data. This is however a bug, as the
file has obviously changed contents.

The test is a bit fragile, as it assumes that the index writing and the
following modification of the file happen in the same second, but it's
enough to show the issue.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We update the index and then immediately change the contents of the
file. This makes the diff think there are no changes, as the timestamp
of the file agrees with the cached data. This is however a bug, as the
file has obviously changed contents.

The test is a bit fragile, as it assumes that the index writing and the
following modification of the file happen in the same second, but it's
enough to show the issue.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #3216 from dprofeta/fixTransactionVisibility</title>
<updated>2015-06-15T21:10:35+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2015-06-15T21:10:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b93dcd4ca423cdb31262cbdc4150dfb7d2e620b7'/>
<id>b93dcd4ca423cdb31262cbdc4150dfb7d2e620b7</id>
<content type='text'>
Fix visibility of transaction symbol</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix visibility of transaction symbol</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #3220 from libgit2/cmn/readdir</title>
<updated>2015-06-15T13:11:32+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2015-06-15T13:11:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=f621f087b2cb6f124a64a57ce2e0113dc92d53bb'/>
<id>f621f087b2cb6f124a64a57ce2e0113dc92d53bb</id>
<content type='text'>
path: remove unnecessary readdir_r usage</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
path: remove unnecessary readdir_r usage</pre>
</div>
</content>
</entry>
<entry>
<title>path: remove unnecessary readdir_r usage</title>
<updated>2015-06-15T11:43:48+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-15T11:28:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=25bd0aaf20463fd9d00d882d39cb1cfec4aa6917'/>
<id>25bd0aaf20463fd9d00d882d39cb1cfec4aa6917</id>
<content type='text'>
Arguably all uses of readdir_r are unnecessary, but in this case
especially so, as the directory handle only exists within this function,
so we don't race with anybody.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Arguably all uses of readdir_r are unnecessary, but in this case
especially so, as the directory handle only exists within this function,
so we don't race with anybody.
</pre>
</div>
</content>
</entry>
</feed>
