A project has the following structure: a master branch whose only commit is M, a develop branch (vertical branch) and many release-X.Y branches (horizontal branches). The o's are regular commits and * are vX.Y.Z-tagged commits. Some useful improvements within release-X.Y branches were merged back into develop (not indicated in diagram).
o -- * -- o -- o -- *
|
o
|
o -- o -- *
|
o
|
M
How to make the master branch "weave through" and "catalog" all the tagged commits in the correct [i.e. lexicographic] order without altering the existing structure?
That is, if the horizontal branches are release-0.1 and release-0.2 and the tagged commits v0.1.0, v0.2.0 and v0.2.1, how to make master such that git log master would produce (modulo extra information)
v0.2.1
v0.2.0
v0.1.0
M
and in the diagram it would be like
.__________.
/ \
o -- * -- o -- o -- *
| \
o \
| \
o -- o -- *
| /
o .___/
| /
M./
(Of course, the specific tree and whether or not the desired commits are tagged is ultimately immaterial to the question, but hopefully it helps to build the context motivating the question: to have master catalog all "official" commits of a software.)
I have looked up possibilities using merge, commit, rebase and cherry-pick commands, but none appears to work (some can create new content-equivalent commits, but the goal is to keep the same exact tagged commits).
There are three questions with a similar title but they are quite different in intent: one, two and three.
I presume it is possible to use low-level instructions which manually set up references and objects to stack the tagged commits on master the right way but I would prefer to have a more systematic, higher-level solution (if there is any).