git - How to determine closest divergent branch-point -


not sure how word question. imagine it's been asked on so pointer existing post great.

complexity: linear in number of commits, not number of named refs. ideally concise sequence of git commands instead of manual loops.

let's have following commit graph:

a   b |  / | /-- c |/ 

a & b named refs start with. less abstract concepts, origin/master & b name of branch conceptually based on a.

finding commits made b diverge trivial & natively supported via ... notation. i'm, however, looking find if there's named ref c happens on path a...b. should not find c in either of graphs below assuming d named ref & c not.

a   b  d |  /  /  | /-- c |/    b |  / | /-- c |/    \ d |     / |    /  ---- 

edit: in example assuming both c & d named refs, expect find d:

a   b |  /-- d | /-- c |/ | | 

in other words, commit closest b head of branch.

in example, d & b different refs same commit, should not find d & instead find c:

a   b, d |  / | /-- c |/ 


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -