<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit.c, branch v2.16.2</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.16.2</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2017-12-28T21:50:05Z</updated>
<entry>
<title>commit: remove unused function clear_commit_marks_for_object_array()</title>
<updated>2017-12-28T21:50:05Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-12-25T17:48:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=6fcec2f9aeeac6329ecf2f7084173f5b4346588b'/>
<id>urn:sha1:6fcec2f9aeeac6329ecf2f7084173f5b4346588b</id>
<content type='text'>
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>commit: use clear_commit_marks_many() in remove_redundant()</title>
<updated>2017-12-28T21:50:05Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-12-25T17:44:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=abc035126a58829cb7265b3ab2f2ca30312aa3b7'/>
<id>urn:sha1:abc035126a58829cb7265b3ab2f2ca30312aa3b7</id>
<content type='text'>
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>commit: avoid allocation in clear_commit_marks_many()</title>
<updated>2017-12-28T21:50:05Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-12-25T17:43:37Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=07f7d55a346f0eb73a358736ce065f8c08b46452'/>
<id>urn:sha1:07f7d55a346f0eb73a358736ce065f8c08b46452</id>
<content type='text'>
Pass the entries of the commit array directly to clear_commit_marks_1()
instead of adding them to a commit_list first.  The function clears the
commit and any first parent without allocation; only higher numbered
parents are added to a list for later treatment.  This change extends
that optimization to clear_commit_marks_many().

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>reduce_heads: fix memory leaks</title>
<updated>2017-11-08T02:34:00Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-11-07T20:39:45Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=4da72644b768b0491110a8ba0aa84d32b6bde41c'/>
<id>urn:sha1:4da72644b768b0491110a8ba0aa84d32b6bde41c</id>
<content type='text'>
We currently have seven callers of `reduce_heads(foo)`. Six of them do
not use the original list `foo` again, and actually, all six of those
end up leaking it.

Introduce and use `reduce_heads_replace(&amp;foo)` as a leak-free version of
`foo = reduce_heads(foo)` to fix several of these. Fix the remaining
leaks using `free_commit_list()`.

While we're here, document `reduce_heads()` and mark it as `extern`.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ma/leakplugs'</title>
<updated>2017-09-29T02:23:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-29T02:23:43Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=69c54c72845ebc686d0f4bdd8d44b06f799b0a80'/>
<id>urn:sha1:69c54c72845ebc686d0f4bdd8d44b06f799b0a80</id>
<content type='text'>
Memory leaks in various codepaths have been plugged.

* ma/leakplugs:
  pack-bitmap[-write]: use `object_array_clear()`, don't leak
  object_array: add and use `object_array_pop()`
  object_array: use `object_array_clear()`, not `free()`
  leak_pending: use `object_array_clear()`, not `free()`
  commit: fix memory leak in `reduce_heads()`
  builtin/commit: fix memory leak in `prepare_index()`
</content>
</entry>
<entry>
<title>commit: fix memory leak in `reduce_heads()`</title>
<updated>2017-09-24T01:05:51Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-09-22T23:34:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cb7b29eb67772d08e2365ed07ede9d954d0344c1'/>
<id>urn:sha1:cb7b29eb67772d08e2365ed07ede9d954d0344c1</id>
<content type='text'>
We don't free the temporary scratch space we use with
`remove_redundant()`. Free it similar to how we do it in
`get_merge_bases_many_0()`.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Reviewed-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 'rs/strbuf-leakfix'</title>
<updated>2017-09-19T01:47:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-19T01:47:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d811ba1897b723fd0146875201061e3603c16391'/>
<id>urn:sha1:d811ba1897b723fd0146875201061e3603c16391</id>
<content type='text'>
Many leaks of strbuf have been fixed.

* rs/strbuf-leakfix: (34 commits)
  wt-status: release strbuf after use in wt_longstatus_print_tracking()
  wt-status: release strbuf after use in read_rebase_todolist()
  vcs-svn: release strbuf after use in end_revision()
  utf8: release strbuf on error return in strbuf_utf8_replace()
  userdiff: release strbuf after use in userdiff_get_textconv()
  transport-helper: release strbuf after use in process_connect_service()
  sequencer: release strbuf after use in save_head()
  shortlog: release strbuf after use in insert_one_record()
  sha1_file: release strbuf on error return in index_path()
  send-pack: release strbuf on error return in send_pack()
  remote: release strbuf after use in set_url()
  remote: release strbuf after use in migrate_file()
  remote: release strbuf after use in read_remote_branches()
  refs: release strbuf on error return in write_pseudoref()
  notes: release strbuf after use in notes_copy_from_stdin()
  merge: release strbuf after use in write_merge_heads()
  merge: release strbuf after use in save_state()
  mailinfo: release strbuf on error return in handle_boundary()
  mailinfo: release strbuf after use in handle_from()
  help: release strbuf on error return in exec_woman_emacs()
  ...
</content>
</entry>
<entry>
<title>commit: release strbuf on error return in commit_tree_extended()</title>
<updated>2017-09-06T23:49:27Z</updated>
<author>
<name>Rene Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-08-30T17:49:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=e505146dac276cc051eca199f9dc7ca88bef5f18'/>
<id>urn:sha1:e505146dac276cc051eca199f9dc7ca88bef5f18</id>
<content type='text'>
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>commit: rewrite read_graft_line</title>
<updated>2017-08-18T19:41:06Z</updated>
<author>
<name>Patryk Obara</name>
<email>patryk.obara@gmail.com</email>
</author>
<published>2017-08-18T18:33:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=cfa5bf16082e25c9221e26851ca890f71ddf5a5f'/>
<id>urn:sha1:cfa5bf16082e25c9221e26851ca890f71ddf5a5f</id>
<content type='text'>
Old implementation determined number of hashes by dividing length of
line by length of hash, which works only if all hash representations
have same length.

New graft line parser works in two phases:

  1. In first phase line is scanned to verify correctness and compute
     number of hashes, then graft struct is allocated.

  2. In second phase line is scanned again to fill up already allocated
     graft struct.

This way graft parsing code can support different sizes of hashes
without any further code adaptations.

A number of alternative implementations were considered and discarded:

  - Modifying graft structure to store oid_array instead of FLEXI_ARRAY
    indicates undesirable usage of struct to readers.

  - Parsing into temporary string_list or oid_array complicates code
    by adding more return paths, as these structures needs to be
    cleared before returning from function.

  - Determining number of hashes by counting separators might cause
    maintenance issues, if this function needs to be modified in future
    again.

Signed-off-by: Patryk Obara &lt;patryk.obara@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: allocate array using object_id size</title>
<updated>2017-08-18T19:18:10Z</updated>
<author>
<name>Patryk Obara</name>
<email>patryk.obara@gmail.com</email>
</author>
<published>2017-08-18T18:33:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=bc65d2262d7c676cc7a0100d8be84a0690e10702'/>
<id>urn:sha1:bc65d2262d7c676cc7a0100d8be84a0690e10702</id>
<content type='text'>
struct commit_graft aggregates an array of object_id's, which have
size &gt;= GIT_MAX_RAWSZ bytes. This change prevents memory allocation
error when size of object_id is larger than GIT_SHA1_RAWSZ.

Signed-off-by: Patryk Obara &lt;patryk.obara@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
