<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/object.h, 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>log: add --show-linear-break to help see non-linear history</title>
<updated>2014-03-25T22:09:49Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-03-25T13:23:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1b32decefd840e0ca5d18eefd6472fd8624dd849'/>
<id>urn:sha1:1b32decefd840e0ca5d18eefd6472fd8624dd849</id>
<content type='text'>
Option explanation is in rev-list-options.txt. The interaction with -z
is left undecided.

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>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>Document some functions defined in object.c</title>
<updated>2014-02-28T21:18:09Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-02-28T16:29:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33bef7ea256e620c579aeff0e672b0becc79c75c'/>
<id>urn:sha1:33bef7ea256e620c579aeff0e672b0becc79c75c</id>
<content type='text'>
Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Acked-by: Nicolas Pitre &lt;nico@fluxnic.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mg/more-textconv'</title>
<updated>2013-10-23T20:21:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-10-23T20:21:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4197361e39a304df30cc492122dbdfe90ae8af0e'/>
<id>urn:sha1:4197361e39a304df30cc492122dbdfe90ae8af0e</id>
<content type='text'>
Make "git grep" and "git show" pay attention to --textconv when
dealing with blob objects.

* mg/more-textconv:
  grep: honor --textconv for the case rev:path
  grep: allow to use textconv filters
  t7008: demonstrate behavior of grep with textconv
  cat-file: do not die on --textconv without textconv filters
  show: honor --textconv for blobs
  diff_opt: track whether flags have been set explicitly
  t4030: demonstrate behavior of show with textconv
</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>object_array_remove_duplicates(): rewrite to reduce copying</title>
<updated>2013-05-28T16:25:01Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2013-05-25T09:08:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1506510c170d23b8f769757dc81904f334c40281'/>
<id>urn:sha1:1506510c170d23b8f769757dc81904f334c40281</id>
<content type='text'>
The old version copied one entry to its destination position, then
deleted any matching entries from the tail of the array.  This
required the tail of the array to be copied multiple times.  It didn't
affect the complexity of the algorithm because the whole tail has to
be searched through anyway.  But all the copying was unnecessary.

Instead, check for the existence of an entry with the same name in the
*head* of the list before copying an entry to its final position.
This way each entry has to be copied at most one time.

Extract a helper function contains_name() to do a bit of the work.

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>object_array: add function object_array_filter()</title>
<updated>2013-05-28T16:25:01Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2013-05-25T09:08:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aeb4a51ef82c71c9a65d11f77aeedb53bea0e983'/>
<id>urn:sha1:aeb4a51ef82c71c9a65d11f77aeedb53bea0e983</id>
<content type='text'>
Add a function that allows unwanted entries in an object_array to be
removed.  This encapsulation is a step towards giving object_array
ownership of its entries' name memory.

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>grep: honor --textconv for the case rev:path</title>
<updated>2013-05-10T17:27:34Z</updated>
<author>
<name>Michael J Gruber</name>
<email>git@drmicha.warpmail.net</email>
</author>
<published>2013-05-10T15:10:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afa15f3cd8f4cbf9572138329be374ff8566b10a'/>
<id>urn:sha1:afa15f3cd8f4cbf9572138329be374ff8566b10a</id>
<content type='text'>
Make "grep" honor the "--textconv" option also for the object case, i.e.
when used with an argument "rev:path".

Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</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>
