<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/streaming.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-09-25T06:24:06Z</updated>
<entry>
<title>Merge branch 'jk/write-in-full-fix'</title>
<updated>2017-09-25T06:24:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-25T06:24:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c50424a6f07f17ff9b06927606df650cd73a09a3'/>
<id>urn:sha1:c50424a6f07f17ff9b06927606df650cd73a09a3</id>
<content type='text'>
Many codepaths did not diagnose write failures correctly when disks
go full, due to their misuse of write_in_full() helper function,
which have been corrected.

* jk/write-in-full-fix:
  read_pack_header: handle signed/unsigned comparison in read result
  config: flip return value of store_write_*()
  notes-merge: use ssize_t for write_in_full() return value
  pkt-line: check write_in_full() errors against "&lt; 0"
  convert less-trivial versions of "write_in_full() != len"
  avoid "write_in_full(fd, buf, len) != len" pattern
  get-tar-commit-id: check write_in_full() return against 0
  config: avoid "write_in_full(fd, buf, len) &lt; len" pattern
</content>
</entry>
<entry>
<title>convert less-trivial versions of "write_in_full() != len"</title>
<updated>2017-09-14T06:17:59Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-09-13T17:16:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=564bde9ae69dc3d60e764078745275b637f90991'/>
<id>urn:sha1:564bde9ae69dc3d60e764078745275b637f90991</id>
<content type='text'>
The prior commit converted many sites to check the return
value of write_in_full() for negativity, rather than a
mismatch with the input length. This patch covers similar
cases, but where the return value is stored in an
intermediate variable. These should get the same treatment,
but they need to be reviewed more carefully since it would
be a bug if the return value is stored in an unsigned type
(which indeed, it is in one of the cases).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move use_pack()</title>
<updated>2017-08-23T22:12:06Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=84f80ad5e11d29b61570269a25cf447f34c5aeba'/>
<id>urn:sha1:84f80ad5e11d29b61570269a25cf447f34c5aeba</id>
<content type='text'>
The function open_packed_git() needs to be temporarily made global. Its
scope will be restored to static in a subsequent commit.

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>Merge branch 'jk/pack-objects-optim-mru'</title>
<updated>2016-10-10T21:03:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-10T21:03:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6e24c94df9df6d39f2316113c14fe07d2ab03d7'/>
<id>urn:sha1:e6e24c94df9df6d39f2316113c14fe07d2ab03d7</id>
<content type='text'>
"git pack-objects" in a repository with many packfiles used to
spend a lot of time looking for/at objects in them; the accesses to
the packfiles are now optimized by checking the most-recently-used
packfile first.

* jk/pack-objects-optim-mru:
  pack-objects: use mru list when iterating over packs
  pack-objects: break delta cycles before delta-search phase
  sha1_file: make packed_object_info public
  provide an initializer for "struct object_info"
</content>
</entry>
<entry>
<title>Merge branch 'jc/verify-loose-object-header'</title>
<updated>2016-10-03T20:30:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-03T20:30:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=71a57ab32d211be19729c3afaf0a7c7283c7a4e2'/>
<id>urn:sha1:71a57ab32d211be19729c3afaf0a7c7283c7a4e2</id>
<content type='text'>
Codepaths that read from an on-disk loose object were too loose in
validating what they are reading is a proper object file and
sometimes read past the data they read from the disk, which has
been corrected.  H/t to Gustavo Grieco for reporting.

* jc/verify-loose-object-header:
  unpack_sha1_header(): detect malformed object header
  streaming: make sure to notice corrupt object
</content>
</entry>
<entry>
<title>streaming: make sure to notice corrupt object</title>
<updated>2016-09-26T17:48:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-26T16:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=97026fe9a6f70b6c0a9e09408a504287c13dea43'/>
<id>urn:sha1:97026fe9a6f70b6c0a9e09408a504287c13dea43</id>
<content type='text'>
The streaming read interface from a loose object called
parse_sha1_header() but discarded its return value, without noticing
a potential error.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>streaming: make stream_blob_to_fd take struct object_id</title>
<updated>2016-09-07T19:59:42Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2016-09-05T20:07:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7eda0e4fbbc243d4103cced29357bb08af36a139'/>
<id>urn:sha1:7eda0e4fbbc243d4103cced29357bb08af36a139</id>
<content type='text'>
Since all of its callers have been updated, modify stream_blob_to_fd to
take a struct object_id.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>provide an initializer for "struct object_info"</title>
<updated>2016-08-11T17:42:23Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-08-11T09:24:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27b5c1a0653026645bd6908ee5abfdceb1c95082'/>
<id>urn:sha1:27b5c1a0653026645bd6908ee5abfdceb1c95082</id>
<content type='text'>
An all-zero initializer is fine for this struct, but because
the first element is a pointer, call sites need to know to
use "NULL" instead of "0". Otherwise some static checkers
like "sparse" will complain; see d099b71 (Fix some sparse
warnings, 2013-07-18) for example.  So let's provide an
initializer to make this easier to get right.

But let's also comment that memset() to zero is explicitly
OK[1]. One of the callers embeds object_info in another
struct which is initialized via memset (expand_data in
builtin/cat-file.c). Since our subset of C doesn't allow
assignment from a compound literal, handling this in any
other way is awkward, so we'd like to keep the ability to
initialize by memset(). By documenting this property, it
should make anybody who wants to change the initializer
think twice before doing so.

There's one other caller of interest. In parse_sha1_header(),
we did not initialize the struct fully in the first place.
This turned out not to be a bug because the sub-function it
calls does not look at any other fields except the ones we
did initialize. But that assumption might not hold in the
future, so it's a dangerous construct. This patch switches
it to initializing the whole struct, which protects us
against unexpected reads of the other fields.

[1] Obviously using memset() to initialize a pointer
    violates the C standard, but we long ago decided that it
    was an acceptable tradeoff in the real world.

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>Merge branch 'sb/plug-streaming-leak'</title>
<updated>2015-04-14T18:49:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-04-14T18:49:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d2ae751b1cae0674e0a1f7fe4da0a341365cefbb'/>
<id>urn:sha1:d2ae751b1cae0674e0a1f7fe4da0a341365cefbb</id>
<content type='text'>
* sb/plug-streaming-leak:
  streaming.c: fix a memleak
</content>
</entry>
<entry>
<title>streaming.c: fix a memleak</title>
<updated>2015-03-31T19:14:42Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2015-03-31T01:22:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ce4ad3e0eac33b4cae38ebd76c26ddba2468631'/>
<id>urn:sha1:9ce4ad3e0eac33b4cae38ebd76c26ddba2468631</id>
<content type='text'>
When stream_blob_to_fd() opens an input stream with a filter, the
filter gets discarded upon calling close_istream() before the
function returns in the normal case.  However, when we fail to open
the stream, we failed to discard the filter.

By discarding the filter in the failure case, give a consistent
life-time rule of the filter to the callers; otherwise the callers
need to conditionally discard the filter themselves, and this
function does not give enough hint for the caller to do so
correctly.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
