Skip to content
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

Mergebase support #409

Open
3 of 6 tasks
Tracked by #411
kalkin opened this issue May 12, 2022 · 0 comments
Open
3 of 6 tasks
Tracked by #411

Mergebase support #409

kalkin opened this issue May 12, 2022 · 0 comments
Assignees
Labels
C-tracking-issue An issue to track to track the progress of multiple PRs or issues

Comments

@kalkin
Copy link
Contributor

kalkin commented May 12, 2022

Should provide:

  • Given two commits a & b check if b is ancestor of a
  • Given n commits, find the first common ancestor
  • Given n commits, find their LCA
  • the equivalent of merge-base --independent (boils down to remove_redundant())

TODO

  • assure commit-graphs aren't used if grafts are present (like in shallow clones), or if object-replacements are active.

Open Questions:

  • How should the api look? Something like this?
    impl Commit {
        fn is_descendant(list: Vec<Id>) -> bool;
    }
    impl Repository {
        /// Return the first found common ancestor
        fn merge_base_first(one: Id, twos: Vec<Id>) -> Result<Option<Id>, Error>;
        /// Return the first least common ancestor
        fn merge_base(one: Id, twos: Vec<Id>) -> Result<Vec<Id>, Error>;
    }

Further reading:

@kalkin kalkin mentioned this issue May 12, 2022
2 tasks
This was referenced May 12, 2022
@Byron Byron added the C-tracking-issue An issue to track to track the progress of multiple PRs or issues label May 15, 2022
@Byron Byron self-assigned this Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue An issue to track to track the progress of multiple PRs or issues
Projects
None yet
Development

No branches or pull requests

2 participants