I have a problem very similar to this one, but I can't figure out how to apply the solution there to my case, because my case is slightly more complex.
Considering the following history:
X0 - X1 - - X - X - Xn - ... - Xinf
\ / / /
\ C - D / /
\ / \ / /
A - E - F - H
\ / \ /
B G
master points to Xinf, and release points to H.
After the release branch was created from master, a bunch of fixes were made. Some of them were only merged into release (e.g. B and G), some of them were merged both into release and master (e.g. C-D). The release branch was also merged back into master several times. In this example I've ensured that all of these things have happened, but in reality they can have happened more times (or less) than indicated by my example.
Given knowledge only about the release and master refs, how can I get a list of all commits in the release branch, i.e. A through H?
I've created a sample repo with the history outlined above to make this easier to test.