There are several questions that are close to what I'm asking, but not quite the same.
I want to list all branches, created off of a git branch at any point in that branch's history.
Answers to similar questions include using git branch --contains [branch-name], but that doesn't accomplish what I'm after.
Consider the following (simple) example & tree:
$ git init
$ git checkout -b master
$ touch master.txt
$ git add .
$ git commit -m "Initial master commit"
$ git checkout -b develop
$ touch develop.txt
$ git add .
$ git commit -m "Initial develop commit"
$ git checkout -b feature/a
$ touch a.txt
$ git add .
$ git commit -m "feature/a commit"
$ git checkout develop
$ git checkout -b feature/b
$ touch b.txt
$ git add .
$ git commit -m "feature/b commit"
master
\
\ feature/a
\ /
develop
\
feature/b
If I want to get all branches that contain the develop branch, I can do git branch --contains develop and I'll get the following result:
$ git branch --contains develop
develop
feature/a
feature/b
Cool. But let's use a more real-world example (-'s are commits) where there are multiple feature branches that are merged in at different times:
$ git checkout develop
$ git merge feature/a
$ git branch -d feature/a
master
\
\ feature/a
\ / \
develop -
\
feature/b
In this case, feature/a was completed, merged into develop, and then deleted. And now the latest commit for develop is ahead of feature/b, which is still being worked on. Now, if I run git branch --contains develop, I get the following:
$ git branch --contains develop
develop
Not cool. What I'd like to see is both develop and feature/b, as feature/b was branched off of an older commit of develop.
I have a complicated project with plenty of feature, bugfix, enhancement, etc. branches that have been made off of various points in develop's lifetime, and not all of them have been pulled in, and right now git branch --contains develop is pretty useless in telling me what branches are outstanding.