Skip to content

Wrong association between commit and repository #1593

@nricciardi

Description

@nricciardi

I'm using GitPython to pull all commits of a repository.
I don't understand why the commits shared between two branches belong to the last generated branch (which contains these commits) and not to the original branch.
For example, I have a repository with a master branch from which they originate a branch named branch2. When I fetch the commits via repo.iter_commits('--all', reverse=True) I have the rev_name of the shared commits as branch2 and not master as I would have expected (branch where the commits were originally created).

Is there a way to get the original branch name?
Of course, I can't check whether the branch name is master, because any other branch creations would have the same problem.

EDIT:
I encountered an additional problem, if there are tags to some commits of the repository, they are used as "branch names". How to fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions