<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit-reach.c, branch v2.23.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.23.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.23.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-02-05T22:26:09Z</updated>
<entry>
<title>Merge branch 'sb/more-repo-in-api'</title>
<updated>2019-02-05T22:26:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-02-05T22:26:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b99a579f8e434a7757f90895945b5711b3f159d5'/>
<id>urn:sha1:b99a579f8e434a7757f90895945b5711b3f159d5</id>
<content type='text'>
The in-core repository instances are passed through more codepaths.

* sb/more-repo-in-api: (23 commits)
  t/helper/test-repository: celebrate independence from the_repository
  path.h: make REPO_GIT_PATH_FUNC repository agnostic
  commit: prepare free_commit_buffer and release_commit_memory for any repo
  commit-graph: convert remaining functions to handle any repo
  submodule: don't add submodule as odb for push
  submodule: use submodule repos for object lookup
  pretty: prepare format_commit_message to handle arbitrary repositories
  commit: prepare logmsg_reencode to handle arbitrary repositories
  commit: prepare repo_unuse_commit_buffer to handle any repo
  commit: prepare get_commit_buffer to handle any repo
  commit-reach: prepare in_merge_bases[_many] to handle any repo
  commit-reach: prepare get_merge_bases to handle any repo
  commit-reach.c: allow get_merge_bases_many_0 to handle any repo
  commit-reach.c: allow remove_redundant to handle any repo
  commit-reach.c: allow merge_bases_many to handle any repo
  commit-reach.c: allow paint_down_to_common to handle any repo
  commit: allow parse_commit* to handle any repo
  object: parse_object to honor its repository argument
  object-store: prepare has_{sha1, object}_file to handle any repo
  object-store: prepare read_object_file to deal with any repo
  ...
</content>
</entry>
<entry>
<title>commit-reach: prepare in_merge_bases[_many] to handle any repo</title>
<updated>2018-11-14T08:22:40Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-11-14T00:12:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d5430f7479d45c3fca088984a08ec093f870b5b'/>
<id>urn:sha1:4d5430f7479d45c3fca088984a08ec093f870b5b</id>
<content type='text'>
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>commit-reach: prepare get_merge_bases to handle any repo</title>
<updated>2018-11-14T08:22:40Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-11-14T00:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=21a9651ba3fb350f48a53bf885a225bf6b71cac3'/>
<id>urn:sha1:21a9651ba3fb350f48a53bf885a225bf6b71cac3</id>
<content type='text'>
Similarly to previous patches, the get_merge_base functions are used
often in the code base, which makes migrating them hard.

Implement the new functions, prefixed with 'repo_' and hide the old
functions behind a wrapper macro.

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>commit-reach.c: allow get_merge_bases_many_0 to handle any repo</title>
<updated>2018-11-14T08:22:40Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-11-14T00:12:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f28e87f526949c547308c16426cc4607464c5f37'/>
<id>urn:sha1:f28e87f526949c547308c16426cc4607464c5f37</id>
<content type='text'>
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>commit-reach.c: allow remove_redundant to handle any repo</title>
<updated>2018-11-14T08:22:40Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-11-14T00:12:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed8a0e3ac5e9c2c625bb86f0de5a82f91075e720'/>
<id>urn:sha1:ed8a0e3ac5e9c2c625bb86f0de5a82f91075e720</id>
<content type='text'>
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>commit-reach.c: allow merge_bases_many to handle any repo</title>
<updated>2018-11-14T08:22:40Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-11-14T00:12:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18256a915c64ac9b6b7ecec4d4c22b7f6fcca507'/>
<id>urn:sha1:18256a915c64ac9b6b7ecec4d4c22b7f6fcca507</id>
<content type='text'>
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>commit-reach.c: allow paint_down_to_common to handle any repo</title>
<updated>2018-11-14T08:22:40Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-11-14T00:12:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c383830a91fcaf402db1051a9cec2eb93cdd6b78'/>
<id>urn:sha1:c383830a91fcaf402db1051a9cec2eb93cdd6b78</id>
<content type='text'>
As the function is file local and not widely used, migrate it all at once.

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>commit-reach: implement get_reachable_subset</title>
<updated>2018-11-02T15:12:06Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-11-02T13:14:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fcb2c0769db54022b5bf3ed134623fbab48cdc20'/>
<id>urn:sha1:fcb2c0769db54022b5bf3ed134623fbab48cdc20</id>
<content type='text'>
The existing reachability algorithms in commit-reach.c focus on
finding merge-bases or determining if all commits in a set X can
reach at least one commit in a set Y. However, for two commits sets
X and Y, we may also care about which commits in Y are reachable
from at least one commit in X.

Implement get_reachable_subset() which answers this question. Given
two arrays of commits, 'from' and 'to', return a commit_list with
every commit from the 'to' array that is reachable from at least
one commit in the 'from' array.

The algorithm is a simple walk starting at the 'from' commits, using
the PARENT2 flag to indicate "this commit has already been added to
the walk queue". By marking the 'to' commits with the PARENT1 flag,
we can determine when we see a commit from the 'to' array. We remove
the PARENT1 flag as we add that commit to the result list to avoid
duplicates.

The order of the resulting list is a reverse of the order that the
commits are discovered in the walk.

There are a couple shortcuts to avoid walking more than we need:

1. We determine the minimum generation number of commits in the
   'to' array. We do not walk commits with generation number
   below this minimum.

2. We count how many distinct commits are in the 'to' array, and
   decrement this count when we discover a 'to' commit during the
   walk. If this number reaches zero, then we can terminate the
   walk.

Tests will be added using the 'test-tool reach' helper in a
subsequent commit.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ds/reachable'</title>
<updated>2018-10-30T06:43:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-30T06:43:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f2d1c83df05e30d7588ba3c28b994d6ebbdbc9b0'/>
<id>urn:sha1:f2d1c83df05e30d7588ba3c28b994d6ebbdbc9b0</id>
<content type='text'>
Trivial bugfix.

* ds/reachable:
  commit-reach: fix cast in compare_commits_by_gen()
</content>
</entry>
<entry>
<title>commit-reach: fix cast in compare_commits_by_gen()</title>
<updated>2018-10-22T22:57:47Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2018-10-01T19:16:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8628ace2691510dc856e2a9c735706fa8f0620e1'/>
<id>urn:sha1:8628ace2691510dc856e2a9c735706fa8f0620e1</id>
<content type='text'>
The elements of the array to be sorted are commit pointers, so the
comparison function gets handed references to these pointers, not
pointers to commit objects.  Cast to the right type and dereference
once to correctly get the commit reference.

Found using Clang's ASan and t5500.

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>
</feed>
