I have a bitbucket server which has 100's of branches. I would like to separate the branches which contain code already on the master branch, and those that dont.
The only way I've thought to get the info would be to get a list of branches:
https://<bitbucket host>/rest/api/1.0/projects/<project>/repos/<MyRepo>/branches
and get the head of each branch
and see whether the commit exists in the list of commits from master:
https://<bitbucket host>/rest/api/1.0/projects/<project>/repos/<MyRepo>/commits?branch=master&limit=1000
'
This is extremely slow. Can anybody think of a better way of doing this? Basically I'm hoping to identify all branches which have been added into master and so can be deleted somewhat safely.
Im thinking that I want the equivalent of:
for each branch:
git rev-list --left-right --count origin/master...origin/FOO
Thanks in advance