<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/bisect.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-02-15T23:18:11Z</updated>
<entry>
<title>Merge branch 'rs/lose-leak-pending' into maint</title>
<updated>2018-02-15T23:18:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-15T23:18:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e17cec27d18c730dae738684d2f5df1dbd54a804'/>
<id>urn:sha1:e17cec27d18c730dae738684d2f5df1dbd54a804</id>
<content type='text'>
API clean-up around revision traversal.

* rs/lose-leak-pending:
  commit: remove unused function clear_commit_marks_for_object_array()
  revision: remove the unused flag leak_pending
  checkout: avoid using the rev_info flag leak_pending
  bundle: avoid using the rev_info flag leak_pending
  bisect: avoid using the rev_info flag leak_pending
  object: add clear_commit_marks_all()
  ref-filter: use clear_commit_marks_many() in do_merge_filter()
  commit: use clear_commit_marks_many() in remove_redundant()
  commit: avoid allocation in clear_commit_marks_many()
</content>
</entry>
<entry>
<title>Merge branch 'ma/bisect-leakfix'</title>
<updated>2018-01-10T22:01:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-01-10T22:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4cc676c46cf07d0302d36e4aea9ecf847510383e'/>
<id>urn:sha1:4cc676c46cf07d0302d36e4aea9ecf847510383e</id>
<content type='text'>
A hotfix for a recent update that broke 'git bisect'.

* ma/bisect-leakfix:
  bisect: fix a regression causing a segfault
</content>
</entry>
<entry>
<title>bisect: fix a regression causing a segfault</title>
<updated>2018-01-03T23:33:46Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2018-01-03T18:48:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e9fdc795cb27725e6dda7f4ba78ec0d9553b36a'/>
<id>urn:sha1:2e9fdc795cb27725e6dda7f4ba78ec0d9553b36a</id>
<content type='text'>
In 7c117184d7 ("bisect: fix off-by-one error in
`best_bisection_sorted()`", 2017-11-05) the more careful logic dealing
with freeing p-&gt;next in 50e62a8e70 ("rev-list: implement
--bisect-all", 2007-10-22) was removed.

Restore the more careful check to avoid segfaulting. Ideally this
would come with a test case, but we don't have steps to reproduce
this, only a backtrace from gdb pointing to this being the issue.

Reported-by: Yasushi SHOJI &lt;yasushi.shoji@gmail.com&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Acked-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: avoid using the rev_info flag leak_pending</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:45:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=148f14ab5e066bb95a9f0bc00380ca98369555dd'/>
<id>urn:sha1:148f14ab5e066bb95a9f0bc00380ca98369555dd</id>
<content type='text'>
The leak_pending flag is so awkward to use that multiple comments had to
be added around each occurrence.  We only use it for remembering the
commits whose marks we have to clear after checking if all of the good
ones are ancestors of the bad one.  This is easy, though: We need to do
that for the bad and good commits, of course.

Let check_good_are_ancestors_of_bad() create and own the array of bad
and good commits, and use it to clear the commit marks as well.

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>Merge branch 'mh/tidy-ref-update-flags'</title>
<updated>2017-11-15T03:14:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-15T03:14:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a97222978ab3e0e86e87dccacf59269a9060de9e'/>
<id>urn:sha1:a97222978ab3e0e86e87dccacf59269a9060de9e</id>
<content type='text'>
Code clean-up in refs API implementation.

* mh/tidy-ref-update-flags:
  refs: update some more docs to use "oid" rather than "sha1"
  write_packed_entry(): take `object_id` arguments
  refs: rename constant `REF_ISPRUNING` to `REF_IS_PRUNING`
  refs: rename constant `REF_NODEREF` to `REF_NO_DEREF`
  refs: tidy up and adjust visibility of the `ref_update` flags
  ref_transaction_add_update(): remove a check
  ref_transaction_update(): die on disallowed flags
  prune_ref(): call `ref_transaction_add_update()` directly
  files_transaction_prepare(): don't leak flags to packed transaction
</content>
</entry>
<entry>
<title>Merge branch 'ma/bisect-leakfix'</title>
<updated>2017-11-15T03:14:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-15T03:14:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f116163171b875f9b58c6f6755bec85460e9b8b8'/>
<id>urn:sha1:f116163171b875f9b58c6f6755bec85460e9b8b8</id>
<content type='text'>
Leak fixes.

* ma/bisect-leakfix:
  bisect: fix memory leak when returning best element
  bisect: fix off-by-one error in `best_bisection_sorted()`
  bisect: fix memory leak in `find_bisection()`
  bisect: change calling-convention of `find_bisection()`
</content>
</entry>
<entry>
<title>Merge branch 'bc/object-id'</title>
<updated>2017-11-06T05:24:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-06T05:24:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e7e456f5007f30997e48dec57a1fc09b6b0f071e'/>
<id>urn:sha1:e7e456f5007f30997e48dec57a1fc09b6b0f071e</id>
<content type='text'>
Conversion from uchar[20] to struct object_id continues.

* bc/object-id: (25 commits)
  refs/files-backend: convert static functions to object_id
  refs: convert read_raw_ref backends to struct object_id
  refs: convert peel_object to struct object_id
  refs: convert resolve_ref_unsafe to struct object_id
  worktree: convert struct worktree to object_id
  refs: convert resolve_gitlink_ref to struct object_id
  Convert remaining callers of resolve_gitlink_ref to object_id
  sha1_file: convert index_path and index_fd to struct object_id
  refs: convert reflog_expire parameter to struct object_id
  refs: convert read_ref_at to struct object_id
  refs: convert peel_ref to struct object_id
  builtin/pack-objects: convert to struct object_id
  pack-bitmap: convert traverse_bitmap_commit_list to object_id
  refs: convert dwim_log to struct object_id
  builtin/reflog: convert remaining unsigned char uses to object_id
  refs: convert dwim_ref and expand_ref to struct object_id
  refs: convert read_ref and read_ref_full to object_id
  refs: convert resolve_refdup and refs_resolve_refdup to struct object_id
  Convert check_connected to use struct object_id
  refs: update ref transactions to use struct object_id
  ...
</content>
</entry>
<entry>
<title>bisect: fix memory leak when returning best element</title>
<updated>2017-11-06T01:15:29Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-11-05T20:24:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f4e45cb3eb6fad4570ff63eecb37bae8102992fc'/>
<id>urn:sha1:f4e45cb3eb6fad4570ff63eecb37bae8102992fc</id>
<content type='text'>
When `find_bisection()` returns a single list entry, it leaks the other
entries. Move the to-be-returned item to the front and free the
remainder.

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>bisect: fix off-by-one error in `best_bisection_sorted()`</title>
<updated>2017-11-06T01:15:29Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-11-05T20:24:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c117184d7e3727d4240beb42148d106483d00b9'/>
<id>urn:sha1:7c117184d7e3727d4240beb42148d106483d00b9</id>
<content type='text'>
After we have sorted the `cnt`-many commits that we have selected, we
place them into the commit list. We then set `p-&gt;next` to NULL, but as
we do so, `p` is already pointing one beyond item number `cnt`. Indeed,
we check whether `p` is NULL before dereferencing it.

This only matters if there are TREESAME-commits. Since they should be
skipped, they are not included in `cnt` and we will hit the situation
where we set `p-&gt;next` to NULL. As a result, the list will be one longer
than it should be. The last commit in the list will be one which occurs
earlier, or which shouldn't be included.

Do not update `p` the very last round in the loop. This ensures that
after the loop, `p-&gt;next` points to the remainder of the list, and we
can set it to NULL. While we're here, free that remainder to fix a
memory leak.

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>bisect: fix memory leak in `find_bisection()`</title>
<updated>2017-11-06T01:15:29Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-11-05T20:24:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc5c40bb2bb1921f3bdfa55c1d846dc080c356b2'/>
<id>urn:sha1:fc5c40bb2bb1921f3bdfa55c1d846dc080c356b2</id>
<content type='text'>
`find_bisection()` rebuilds the commit list it is given by reversing it
and skipping uninteresting commits. The uninteresting list entries are
leaked. Free them to fix the leak.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
