ishepard / pydriller

Python Framework to analyse Git repositories

Home Page:http://pydriller.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting the commited branch

erenturkm opened this issue · comments

Hi,

My organization has large number of repos for my project that is hosted on bitbucket. I am analyzing the git logs from my own machine and I need to know which branch the commit was done for. I can see the pull-requests from bitbucket and see which branch it was merged to. I know pull requests are not part of Git but I am not looking for the approval process, just where it was merged to.

When I get the logs from pydriller, I can get the merged from branch from git commit message. I also get the list of branches from commit.branches property. When there is a single branch that info gives me the merged into branch. However when there are multiple, I can not identify the merged into branch. Is there a way to get this info from any pydriller methods?

Hi @erenturkm!
Mmmmm good question, I don't really know. Is there a git command that can give you that info? If so, we can try to write it in Pydriller.

This seems to be a hard topic. StackOverflow can provide some context. I did use "git reflog show --all | grep xxxxxx" type of commands in my script successfully to get the information.

What you pinged seems to find the branch the commit comes from.
I thought your question was to find the commit is merged to. No?

Anyway, yeah it seems there is no easy way.