<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/bundle.c, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-04-03T19:38:11Z</updated>
<entry>
<title>Merge branch 'nd/log-show-linear-break'</title>
<updated>2014-04-03T19:38:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-03T19:38:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b407d40933f9c37af16ca3dc275e615ab4fdd8c5'/>
<id>urn:sha1:b407d40933f9c37af16ca3dc275e615ab4fdd8c5</id>
<content type='text'>
Attempts to show where a single-strand-of-pearls break in "git log"
output.

* nd/log-show-linear-break:
  log: add --show-linear-break to help see non-linear history
  object.h: centralize object flag allocation
</content>
</entry>
<entry>
<title>object.h: centralize object flag allocation</title>
<updated>2014-03-25T22:09:24Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-03-25T13:23:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=208acbfb82f722fb22320c381e7da8c8fb2e37e8'/>
<id>urn:sha1:208acbfb82f722fb22320c381e7da8c8fb2e37e8</id>
<content type='text'>
While the field "flags" is mainly used by the revision walker, it is
also used in many other places. Centralize the whole flag allocation to
one place for a better overview (and easier to move flags if we have
too).

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sh/use-hashcpy'</title>
<updated>2014-03-18T20:51:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-18T20:51:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=006f678780e816a2540628e5473b0eea199d0b61'/>
<id>urn:sha1:006f678780e816a2540628e5473b0eea199d0b61</id>
<content type='text'>
* sh/use-hashcpy:
  Use hashcpy() when copying object names
</content>
</entry>
<entry>
<title>Use hashcpy() when copying object names</title>
<updated>2014-03-06T22:03:12Z</updated>
<author>
<name>Sun He</name>
<email>sunheehnus@gmail.com</email>
</author>
<published>2014-03-03T09:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50546b15ed1df25837f8b291e6fa5bbcdb84635e'/>
<id>urn:sha1:50546b15ed1df25837f8b291e6fa5bbcdb84635e</id>
<content type='text'>
We invented hashcpy() to keep the abstraction of "object name"
behind it.  Use it instead of calling memcpy() with hard-coded
20-byte length when moving object names between pieces of memory.

Leave ppc/sha1.c as-is, because the function is about the SHA-1 hash
algorithm whose output is and will always be 20 bytes.

Helped-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Helped-by: Duy Nguyen &lt;pclouds@gmail.com&gt;
Signed-off-by: Sun He &lt;sunheehnus@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle.c: use ALLOC_GROW() in add_to_ref_list()</title>
<updated>2014-03-03T22:44:48Z</updated>
<author>
<name>Dmitry S. Dolzhenko</name>
<email>dmitrys.dolzhenko@yandex.ru</email>
</author>
<published>2014-03-03T22:31:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5cbbe13a9f16e7ddebd186dbf1dddb16185b968f'/>
<id>urn:sha1:5cbbe13a9f16e7ddebd186dbf1dddb16185b968f</id>
<content type='text'>
Signed-off-by: Dmitry S. Dolzhenko &lt;dmitrys.dolzhenko@yandex.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bundle: use argv-array</title>
<updated>2013-11-12T21:32:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-11-12T21:32:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e2371ea6656beaf94fd706eb414febac88c6398'/>
<id>urn:sha1:1e2371ea6656beaf94fd706eb414febac88c6398</id>
<content type='text'>
Instead of hand-crafted arrays to manage command line arguments
we create internally, use argv-array helpers.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object_array_entry: fix memory handling of the name field</title>
<updated>2013-06-02T22:28:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2013-05-25T09:08:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=31faeb2088ef35d0108ad81df3550513d6cec798'/>
<id>urn:sha1:31faeb2088ef35d0108ad81df3550513d6cec798</id>
<content type='text'>
Previously, the memory management of the object_array_entry::name
field was inconsistent and undocumented.  object_array_entries are
ultimately created by a single function, add_object_array_with_mode(),
which has an argument "const char *name".  This function used to
simply set the name field to reference the string pointed to by the
name parameter, and nobody on the object_array side ever freed the
memory.  Thus, it assumed that the memory for the name field would be
managed by the caller, and that the lifetime of that string would be
at least as long as the lifetime of the object_array_entry.  But
callers were inconsistent:

* Some passed pointers to constant strings or argv entries, which was
  OK.

* Some passed pointers to newly-allocated memory, but didn't arrange
  for the memory ever to be freed.

* Some passed the return value of sha1_to_hex(), which is a pointer to
  a statically-allocated buffer that can be overwritten at any time.

* Some passed pointers to refnames that they received from a
  for_each_ref()-type iteration, but the lifetimes of such refnames is
  not guaranteed by the refs API.

Bring consistency to this mess by changing object_array to make its
own copy for the object_array_entry::name field and free this memory
when an object_array_entry is deleted from the array.

Many callers were passing the empty string as the name parameter, so
as a performance optimization, treat the empty string specially.
Instead of making a copy, store a pointer to a statically-allocated
empty string to object_array_entry::name.  When deleting such an
entry, skip the free().

Change the callers that were already passing copies to
add_object_array_with_mode() to either skip the copy, or (if the
memory needed to be allocated anyway) freeing the memory itself.

A part of this commit effectively reverts

    70d26c6e76 read_revisions_from_stdin: make copies for handle_revision_arg

because the copying introduced by that commit (which is still
necessary) is now done at a deeper level.

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: Accept prerequisites without commit messages</title>
<updated>2013-04-07T21:45:56Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>git@cryptocrack.de</email>
</author>
<published>2013-04-07T11:53:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5446e33f35d6b27b6b760a59a6ded33fbd555190'/>
<id>urn:sha1:5446e33f35d6b27b6b760a59a6ded33fbd555190</id>
<content type='text'>
While explicitly stating that the commit message in a prerequisite
line is optional, we required all lines with 40 or more characters
to contain a space after the object name, bailing out if a line
consisted of an object name only. This was to allow bundling a
history to a commit without an message, but the code forgot that it
already called rtrim() to remove that whitespace.

As a workaround, only check for SP when the line has more than 40
characters.

Signed-off-by: Lukas Fleischer &lt;git@cryptocrack.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/fully-peeled-packed-ref' into maint-1.8.1</title>
<updated>2013-04-03T15:43:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-04-03T15:43:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1ad05f3a524a8750533d8263ceb584a9e7ec573'/>
<id>urn:sha1:f1ad05f3a524a8750533d8263ceb584a9e7ec573</id>
<content type='text'>
* jk/fully-peeled-packed-ref:
  pack-refs: add fully-peeled trait
  pack-refs: write peeled entry for non-tags
  use parse_object_or_die instead of die("bad object")
  avoid segfaults on parse_object failure
</content>
</entry>
<entry>
<title>avoid segfaults on parse_object failure</title>
<updated>2013-03-17T19:49:03Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-03-17T08:22:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=75a95490474ab6e991cbbbd10d980498a9109648'/>
<id>urn:sha1:75a95490474ab6e991cbbbd10d980498a9109648</id>
<content type='text'>
Many call-sites of parse_object assume that they will get a
non-NULL return value; this is not the case if we encounter
an error while parsing the object.

This patch adds a wrapper function around parse_object that
handles dying automatically, and uses it anywhere we
immediately try to access the return value as a non-NULL
pointer (i.e., anywhere that we would currently segfault).

This wrapper may also be useful in other places. The most
obvious one is code like:

  o = parse_object(sha1);
  if (!o)
	  die(...);

However, these should not be mechanically converted to
parse_object_or_die, as the die message is sometimes
customized. Later patches can address these sites on a
case-by-case basis.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
