pydriller icon indicating copy to clipboard operation
pydriller copied to clipboard

Getting the commited branch

Open erenturkm opened this issue 2 years ago • 3 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?

erenturkm avatar Sep 02 '22 13:09 erenturkm

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.

ishepard avatar Sep 07 '22 10:09 ishepard

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.

erenturkm avatar Sep 07 '22 17:09 erenturkm

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.

ishepard avatar Sep 11 '22 16:09 ishepard