Finding merge commits from tag across branches in git : <p>My product is a plugin for IntelliJ. I support several versions of the underlying IntelliJ platform, and release builds of my plugin for each one since their APIs often change between versions. It's just me working on it, so I develop in master and then maintain a branch for each of the other versions. So my repo looks like this:</p>

<pre><code>   1.6.0  1.6.1-eap1
.... a---b---c--- master
      \       \
       d-------e--- idea-2017.1
        \       \
         f-------g--- idea-2016.3
          \       \
          ...     ...  etc etc
</code></pre>

<p><code>a</code> is a stable release, and has been tagged with <code>1.6.0</code>. <code>c</code> is an EAP (beta) release, and has been tagged with <code>1.6.1-eap1</code>. This scheme works fine for these two cases.</p>

<p>Occasionally I'd like to create a dev build which doesn't go into a release channel, but that users can download manually and test out if they like. I'd like to produce a dev build for each platform, since dev users could be using any IntelliJ version. The best way I can think of would be to create a branch for the dev build from, say, tag <code>1.6.0</code> (commit <code>a</code>), and then corresponding branches from commits <code>d</code>, <code>f</code> and so on which I can merge the dev branch into and create dev builds from. </p>

<p>Assuming I want to write a script to create and maintain these branches, how can I find commits <code>d</code>, <code>f</code> and so on from the tag <code>1.6.0</code> to create the dev build branches from?</p>
