I understand I can get the branches currently unmerged to master
in git with
git branch -r --no-merged master
What if I want to see the same for a historical commit but consider the state of branches at that time (including branches that have since been deleted) and not the current branches?
And in the end all I need is a count. Ultimately I'm trying to answer this question:
For each day in the history of a git repo (or for the last X days/months) how many branches existed that were unmerged to master on that day?
Edit: To be clear I only need a count of unmerged branches given a specific commit. I don’t need branch names. I.e. if I could take a cross-section of the log output that shows history graphically and count the lines that represent all branches at any given commit I’d be in good shape. I just don’t want to have to build that out if someone already has.
Edit 2: What about counting commits that are older than the commit in question and have a shared parent and subtract those that have more than one parent. See this diagram: