最佳答案
Git is a DAG of snapshots, with each node on the graph representing a commit. Each commit can have 'n' parent commits.
Given any two commits, is there a single, concise way to discern the "order" of these two in the DAG. git rev-list
seems to be the most promising, but I can't seem to find the right incantation.
Ideally, I'd have something like the following
$ git related hash1 hash2
hash1 is ancestor of hash2
OR
hash2 is ancestor of hash1
OR
hash1 unrelated to hash2
OR
hash1 is equal to hash2