<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/bundle.c, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-08-10T19:57:14Z</updated>
<entry>
<title>create_bundle(): duplicate file descriptor to avoid closing it twice</title>
<updated>2015-08-10T19:57:14Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2015-08-10T09:47:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e54c347c1c444c0f37b64b8735c50a66ee0527e9'/>
<id>urn:sha1:e54c347c1c444c0f37b64b8735c50a66ee0527e9</id>
<content type='text'>
write_pack_data() passes bundle_fd to start_command() to be used as
the stdout of pack-objects. But start_command() closes its stdout if
it is &gt; 1. This is a problem if bundle_fd is the fd of a lock_file,
because commit_lock_file() will also try to close the fd.

So the old code suppressed commit_lock_file()'s usual behavior of
closing the file descriptor by setting the lock_file object's fd field
to -1.

But this is not really kosher. Code here shouldn't be mutating fields
within the lock_file object.

Instead, duplicate the file descriptor before passing it to
write_pack_data(). Then that function can close its copy without
closing the copy held in the lock_file object.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle.c: fix memory leak</title>
<updated>2015-03-11T03:53:52Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2015-03-10T23:51:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8a571d8bcef7f5687b5eb86654805c39f236e5d'/>
<id>urn:sha1:c8a571d8bcef7f5687b5eb86654805c39f236e5d</id>
<content type='text'>
There was one continue statement without an accompanying `free(ref)`.
Instead of adding that, replace all the free&amp;&amp;continue with a goto
just after writing the refs, where we'd do the free anyway and then
reloop.

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>bundle: split out ref writing from bundle_create</title>
<updated>2014-10-30T21:52:45Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-10-30T21:35:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9362ef9b91ea2dccc80553dbcb37dc6c5d78548'/>
<id>urn:sha1:d9362ef9b91ea2dccc80553dbcb37dc6c5d78548</id>
<content type='text'>
The bundle_create() function has a number of logical steps:
process the input, write the refs, and write the packfile.
Recent commits split the first and third into separate
sub-functions. It's worth splitting the middle step out,
too, if only because it makes the progression of the steps
more obvious.

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>bundle: split out a helper function to compute and write prerequisites</title>
<updated>2014-10-30T21:51:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-30T18:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8eb25122e2cf966bf774fd0e3596d1b3dc93be6'/>
<id>urn:sha1:e8eb25122e2cf966bf774fd0e3596d1b3dc93be6</id>
<content type='text'>
The new helper compute_and_write_prerequistes() is ugly, but it
cannot be avoided.  Ideally we should avoid a function that computes
and does I/O at the same time, but the prerequisites lines in the
output needs the human readable title only to help the recipient of
the bundle.  The code copies them straight from the rev-list output
and immediately discards as no other internal computation needs that
information.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle: split out a helper function to create pack data</title>
<updated>2014-10-30T21:45:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-30T17:45:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5e626b91d4a5d2cfee8747facd53d7661f1f9112'/>
<id>urn:sha1:5e626b91d4a5d2cfee8747facd53d7661f1f9112</id>
<content type='text'>
The create_bundle() function, while it does one single logical
thing, takes a rather large implementation to do so.

Let's start separating what it does into smaller steps to make it
easier to see what is going on.  This is a first step to separate
out the actual pack-data generation, after the earlier part of the
function figures out which part of the history to place in the
bundle.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use child_process_init() to initialize struct child_process variables</title>
<updated>2014-10-28T21:56:17Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-10-28T20:52:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8828f2985f1967201c256fb01f92a91acfdb5001'/>
<id>urn:sha1:8828f2985f1967201c256fb01f92a91acfdb5001</id>
<content type='text'>
Call child_process_init() instead of zeroing the memory of variables of
type struct child_process by hand before use because the former is both
clearer and shorter.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs.c: change resolve_ref_unsafe reading argument to be a flags field</title>
<updated>2014-10-15T17:47:24Z</updated>
<author>
<name>Ronnie Sahlberg</name>
<email>sahlberg@google.com</email>
</author>
<published>2014-07-15T19:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7695d118e5a3c9c6fcb4cb15eb766a1c57422aed'/>
<id>urn:sha1:7695d118e5a3c9c6fcb4cb15eb766a1c57422aed</id>
<content type='text'>
resolve_ref_unsafe takes a boolean argument for reading (a nonexistent ref
resolves successfully for writing but not for reading).  Change this to be
a flags field instead, and pass the new constant RESOLVE_REF_READING when
we want this behaviour.

While at it, swap two of the arguments in the function to put output
arguments at the end.  As a nice side effect, this ensures that we can
catch callers that were unaware of the new API so they can be audited.

Give the wrapper functions resolve_refdup and read_ref_full the same
treatment for consistency.

Signed-off-by: Ronnie Sahlberg &lt;sahlberg@google.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/plug-leak-in-bundle'</title>
<updated>2014-10-14T17:50:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-14T17:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0189df3161986643565f12418a8c64edbc42de2e'/>
<id>urn:sha1:0189df3161986643565f12418a8c64edbc42de2e</id>
<content type='text'>
* rs/plug-leak-in-bundle:
  bundle: plug minor memory leak in is_tag_in_date_range()
</content>
</entry>
<entry>
<title>bundle: plug minor memory leak in is_tag_in_date_range()</title>
<updated>2014-10-07T17:48:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-10-03T22:40:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64045940af0539f15335d7664908e74d1febc439'/>
<id>urn:sha1:64045940af0539f15335d7664908e74d1febc439</id>
<content type='text'>
Free the buffer returned by read_sha1_file() even if no valid tagger
line is found.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&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>lockfile.h: extract new header file for the functions in lockfile.c</title>
<updated>2014-10-01T20:56:14Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-10-01T10:28:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=697cc8efd944a32ca472337cd6640004c474b788'/>
<id>urn:sha1:697cc8efd944a32ca472337cd6640004c474b788</id>
<content type='text'>
Move the interface declaration for the functions in lockfile.c from
cache.h to a new file, lockfile.h. Add #includes where necessary (and
remove some redundant includes of cache.h by files that already
include builtin.h).

Move the documentation of the lock_file state diagram from lockfile.c
to the new header file.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
