Skip to content

Add git merge-base command into GitPython #169

@jwir3

Description

@jwir3

It would be nice if there was a way in the GitPython API to do the following native git command:

git merge-base <commit 1> <commit 2>

For example, it would be nice to be able to perform the following:

from git import *

repo = Repo('/path/to/repo')
base = repo.find_last_common_ancestor('de1f33', '78dd34')
print(base)

The expected output, assuming the least common ancestor of 'de1f33' and '78dd34' was '6ff871', (obviously all of these commits have fictional SHAs) would be:

<git.Commit "6ff871652e0f3b9fa991bbd9b42e520f91723436e">

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy