Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrong association between commit and repository #1595

Unanswered
nricciardi asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 1 comment

Comment options

It's hard to understand what's going on here and probably out of the scope of GitPython. From what I see, those questions are more related to what git does, which is always used under the hood here as well. I recommend to take a look at the underlying git commands and explore what's happening by invoking git commands directly.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1593 on May 21, 2023 07:54.

AltStyle によって変換されたページ (->オリジナル) /