Skip to content

graph: Create git_graph_reachable_from_any() #5767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 27, 2021

Conversation

lhchavez
Copy link
Contributor

@lhchavez lhchavez commented Jan 7, 2021

This change introduces a new API function
git_graph_reachable_from_any(), that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a commit-graph file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: #5757

@lhchavez lhchavez mentioned this pull request Jan 7, 2021
8 tasks
@lhchavez lhchavez force-pushed the cgraph-reachable-from-any branch 3 times, most recently from 5642341 to 2de5486 Compare January 7, 2021 05:09
Base automatically changed from master to main January 7, 2021 10:10
@lhchavez lhchavez force-pushed the cgraph-reachable-from-any branch 4 times, most recently from 89b8999 to 744c6bb Compare January 10, 2021 21:28
@lhchavez lhchavez force-pushed the cgraph-reachable-from-any branch from 744c6bb to 4e717cc Compare March 11, 2021 02:11
@lhchavez lhchavez force-pushed the cgraph-reachable-from-any branch from 4e717cc to 033048d Compare July 27, 2021 01:47
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
@lhchavez lhchavez force-pushed the cgraph-reachable-from-any branch from 033048d to ce5400c Compare July 27, 2021 15:14
Copy link
Member

@ethomson ethomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not perfectly consistent but we usually do array, len instead of len, array. (in fact, it's git_merge_base that is the outlier, 😢). But I'd like to keep new functionality using array, len

@lhchavez lhchavez requested a review from ethomson July 27, 2021 20:01
@ethomson ethomson dismissed their stale review July 27, 2021 20:18

fixed

Copy link
Member

@ethomson ethomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ethomson ethomson merged commit f08cae1 into libgit2:main Jul 27, 2021
@lhchavez lhchavez deleted the cgraph-reachable-from-any branch July 28, 2021 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants