On Tue, Mar 8, 2011 at 12:12 PM, Jeff King <peff@xxxxxxxx> wrote: > On Tue, Mar 08, 2011 at 05:11:16AM -0500, Jay Soffian wrote: > >> Going back to my original picture, I mean commit m: >> >>  o---o---x---o---...  Âfoo >>  Â\    \ >>   o---o---m---o---... Âbar >> >> merge-base foo bar gives me x; to get m I then need to grep the output >> of rev-list --parents for x. > > Isn't the merge the first commit in bar that is not in foo? IOW: No, because bar is never merged to foo. Let me relabel the picture:  o---o---x---o---...  Âfoo  Â\    \   a---b---c---d---... Âbar > Âgit rev-list foo..bar | tail -n 1 That would return 'a'. merge-base foo bar returns x. I want 'c'. So again, I can do either: $ git rev-list foo bar --merges --parents | grep " $(git merge-base foo bar)" Or: $ git rev-list --ancestry-path foo...bar ^foo | tail -n 1 I guess this is not at all a common thing, since it seems to be confounding the list. :-) My use case is that I maintain a downstream project, so bar never merges back to foo, but sometimes I ask the question "what have we done on bar since we last merged in foo". I think --ancestry-path really is the answer: $ git log --reverse --ancestry-path foo...bar ^foo Is actually quite nice. j. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html