<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src, branch cmn/index-checksum</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/'/>
<entry>
<title>index: make relative comparison use the checksum as well</title>
<updated>2015-06-20T14:17:28+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-20T14:17:28+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=624c949f01ca553fdd0b42fbac439e822c1bdd5f'/>
<id>624c949f01ca553fdd0b42fbac439e822c1bdd5f</id>
<content type='text'>
This is used by the submodule in order to figure out if the index has
changed since it last read it. Using a timestamp is racy, so let's make
it use the checksum, just like we now do for reloading the index itself.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is used by the submodule in order to figure out if the index has
changed since it last read it. Using a timestamp is racy, so let's make
it use the checksum, just like we now do for reloading the index itself.
</pre>
</div>
</content>
</entry>
<entry>
<title>index: use the checksum to check whether it's been modified</title>
<updated>2015-06-19T20:05:08+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-19T20:05:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=5e947c91d49aacc8abb5b3f018737c72c52486a9'/>
<id>5e947c91d49aacc8abb5b3f018737c72c52486a9</id>
<content type='text'>
We currently use a timetamp to check whether an index file has been
modified since we last read it, but this is racy. If two updates happen
in the same second and we read after the first one, we won't detect the
second one.

Instead read the SHA-1 checksum of the file, which are its last 20 bytes which
gives us a sure-fire way to detect whether the file has changed since we
last read it.

As we're now keeping track of it, expose an accessor to this data.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We currently use a timetamp to check whether an index file has been
modified since we last read it, but this is racy. If two updates happen
in the same second and we read after the first one, we won't detect the
second one.

Instead read the SHA-1 checksum of the file, which are its last 20 bytes which
gives us a sure-fire way to detect whether the file has changed since we
last read it.

As we're now keeping track of it, expose an accessor to this data.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #3219 from libgit2/cmn/racy-diff</title>
<updated>2015-06-17T06:15:49+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-17T06:15:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=a56db99234017eb7814258dfe8bcdec365417a3b'/>
<id>a56db99234017eb7814258dfe8bcdec365417a3b</id>
<content type='text'>
Zero out racily-clean entries' file_size</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Zero out racily-clean entries' file_size</pre>
</div>
</content>
</entry>
<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://91.123.203.49/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>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://91.123.203.49/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>Merge pull request #3209 from libgit2/cmn/double-author</title>
<updated>2015-06-16T14:40:46+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2015-06-16T14:40:46+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=5f83758fa35a7942457d676e41240dbfbda598b5'/>
<id>5f83758fa35a7942457d676e41240dbfbda598b5</id>
<content type='text'>
commit: ignore multiple author fields</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit: ignore multiple author fields</pre>
</div>
</content>
</entry>
<entry>
<title>remote: return EINVALIDSPEC when given an empty URL</title>
<updated>2015-06-16T12:04:23+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-16T10:39:11+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=47a40d1d4421b0081622c1bf4af4f58ebb497ed5'/>
<id>47a40d1d4421b0081622c1bf4af4f58ebb497ed5</id>
<content type='text'>
This is what we used to return in the settter and there's tests in
bindings which ask for this. There's no particular reason to stop doing
so.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is what we used to return in the settter and there's tests in
bindings which ask for this. There's no particular reason to stop doing
so.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #3221 from git-up/build_warnings</title>
<updated>2015-06-16T07:20:36+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-16T07:20:36+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/libgit2.git/commit/?id=aeb2b991b0e645100976db620e50da65c51db66e'/>
<id>aeb2b991b0e645100976db620e50da65c51db66e</id>
<content type='text'>
Fixed Xcode 6.1 build warnings</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed Xcode 6.1 build warnings</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://91.123.203.49/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://91.123.203.49/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>
</feed>
