<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/packfile.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-09T23:57:24Z</updated>
<entry>
<title>cleanup: fix possible overflow errors in binary search</title>
<updated>2017-10-09T23:57:24Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2017-10-08T18:29:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19716b21a4255ecc7148b54ab2c78039c59f25bf'/>
<id>urn:sha1:19716b21a4255ecc7148b54ab2c78039c59f25bf</id>
<content type='text'>
A common mistake when writing binary search is to allow possible
integer overflow by using the simple average:

	mid = (min + max) / 2;

Instead, use the overflow-safe version:

	mid = min + (max - min) / 2;

This translation is safe since the operation occurs inside a loop
conditioned on "min &lt; max". The included changes were found using
the following git grep:

	git grep '/ *2;' '*.c'

Making this cleanup will prevent future review friction when a new
binary search is contructed based on existing code.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/read-in-full'</title>
<updated>2017-10-03T06:42:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-10-03T06:42:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb1083ca23c2f78140b66b925ed0b82fe400eea5'/>
<id>urn:sha1:cb1083ca23c2f78140b66b925ed0b82fe400eea5</id>
<content type='text'>
Code clean-up to prevent future mistakes by copying and pasting
code that checks the result of read_in_full() function.

* jk/read-in-full:
  worktree: check the result of read_in_full()
  worktree: use xsize_t to access file size
  distinguish error versus short read from read_in_full()
  avoid looking at errno for short read_in_full() returns
  prefer "!=" when checking read_in_full() result
  notes-merge: drop dead zero-write code
  files-backend: prefer "0" for write_in_full() error check
</content>
</entry>
<entry>
<title>distinguish error versus short read from read_in_full()</title>
<updated>2017-09-27T06:45:24Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-09-27T06:02:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41dcc4dcccecca49e3f75212ce9e614ffe2bdcc8'/>
<id>urn:sha1:41dcc4dcccecca49e3f75212ce9e614ffe2bdcc8</id>
<content type='text'>
Many callers of read_in_full() expect to see the exact
number of bytes requested, but their error handling lumps
together true read errors and short reads due to unexpected
EOF.

We can give more specific error messages by separating these
cases (showing errno when appropriate, and otherwise
describing the short read).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: make packed_git_mru global a value instead of a pointer</title>
<updated>2017-09-14T06:05:48Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2017-09-12T17:28:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=607bd8315c6886eb61561bbba394616bc6fdf031'/>
<id>urn:sha1:607bd8315c6886eb61561bbba394616bc6fdf031</id>
<content type='text'>
The MRU cache that keeps track of recently used packs is represented
using two global variables:

	struct mru packed_git_mru_storage;
	struct mru *packed_git_mru = &amp;packed_git_mru_storage;

Callers never assign to the packed_git_mru pointer, though, so we can
simplify by eliminating it and using &amp;packed_git_mru_storage (renamed
to &amp;packed_git_mru) directly.  This variable is only used by the
packfile subsystem, making this a relatively uninvasive change (and
any new unadapted callers would trigger a compile error).

Noticed while moving these globals to the object_store struct.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move for_each_packed_object()</title>
<updated>2017-08-23T22:12:07Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7709f468fdeece2a99d60a581a4ced65cd2844df'/>
<id>urn:sha1:7709f468fdeece2a99d60a581a4ced65cd2844df</id>
<content type='text'>
Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move has_pack_index()</title>
<updated>2017-08-23T22:12:07Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f9a8672a81277b83cabd59c6705089351c4f3ec4'/>
<id>urn:sha1:f9a8672a81277b83cabd59c6705089351c4f3ec4</id>
<content type='text'>
Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move has_sha1_pack()</title>
<updated>2017-08-23T22:12:07Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=150e3001d0c5cc69db72a10f3e0cd1e14f11acba'/>
<id>urn:sha1:150e3001d0c5cc69db72a10f3e0cd1e14f11acba</id>
<content type='text'>
Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move find_pack_entry() and make it global</title>
<updated>2017-08-23T22:12:07Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a1e5d4f47fd77dec1b7e7ef0867939a251252b6'/>
<id>urn:sha1:1a1e5d4f47fd77dec1b7e7ef0867939a251252b6</id>
<content type='text'>
This function needs to be global as it is used by sha1_file.c and will
be used by packfile.c.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move find_sha1_pack()</title>
<updated>2017-08-23T22:12:07Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d6fe0036fd5e0cf7f51aa84381ebd321e898350a'/>
<id>urn:sha1:d6fe0036fd5e0cf7f51aa84381ebd321e898350a</id>
<content type='text'>
Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move find_pack_entry_one(), is_pack_valid()</title>
<updated>2017-08-23T22:12:07Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a2551953b9619b285128c1e9cf35120fb7555d8f'/>
<id>urn:sha1:a2551953b9619b285128c1e9cf35120fb7555d8f</id>
<content type='text'>
Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
