<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/streaming.c, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-10-10T21:03:47Z</updated>
<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>
<entry>
<title>open_istream(): do not dereference NULL in the error case</title>
<updated>2014-02-19T00:00:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-02-19T00:00:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78368f2c1ad342719ccf1e719bd5126ca6c7b68b'/>
<id>urn:sha1:78368f2c1ad342719ccf1e719bd5126ca6c7b68b</id>
<content type='text'>
When stream-filter cannot be attached, it is expected to return NULL,
and we should close the stream we opened and signal an error by
returning NULL ourselves from this function.

However, we attempted to dereference that NULL pointer between the
point we detected the error and returned from the function.

Brought-to-attention-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ef/mingw-write'</title>
<updated>2014-01-27T18:44:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-01-27T18:44:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b4e2b7e6aba677fcefffde79d0d3a53ae623b4f'/>
<id>urn:sha1:7b4e2b7e6aba677fcefffde79d0d3a53ae623b4f</id>
<content type='text'>
* ef/mingw-write:
  mingw: remove mingw_write
  prefer xwrite instead of write
</content>
</entry>
<entry>
<title>prefer xwrite instead of write</title>
<updated>2014-01-17T20:09:26Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2014-01-17T14:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7edc02f4deedb3a11abeb328dc2596b2886c2f47'/>
<id>urn:sha1:7edc02f4deedb3a11abeb328dc2596b2886c2f47</id>
<content type='text'>
Our xwrite wrapper already deals with a few potential hazards, and
are as such more robust. Prefer it instead of write to get the
robustness benefits everywhere.

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Reviewed-and-improved-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
