Given a large git repository with hundreds of branches / thousands of commits, and an irregular branch merging strategy, how does one determine the shortest path between two commits? In other words, What path of branches from earlier commit A to later commit B crosses the least number of commits?
(In my case I'm trying to trace the history of a 'develop' branch that had inadvertently been merged into feature branches via fast-forward. A "shortest path" strategy seemed like a practical approach, but I've been looking through the help pages for git-log and git-rev-list [v1.8.3.1], but haven't found any option that seems to do this. Am I missing something obvious?)
Maybe not fully related, but this worked for me "to trace the history of a 'develop'" so that I got log with only commits on 'develop' (without commits on merged branches).
25ab137285
and2fbdf0a100
are commits on desired branch (e.g.develop
)--first-parent - main part
--ancestry-path - believe that it helps