: A T / \\ i B C m : : e D E \\ / | F V :
git merge-base
Adapt all.awk from this answer to also carry the line number for each ref, then when you've encountered both parents look at the refs they have in common.
all.awk