Simple Scenario: I have few commits on git branch A which was forked from master some time back. I would like to find out all pending commits that need to be merged back to master. Following command gives me list of these commits. $git log --cherry --oneline master..A
Now, in bit more complex scenario, I have another branch B which was also forked from master and has few commits that I would now like to integrate back to the master. However, couple of my developers have already cherry picked some of these commits onto their "private" branches (say, b1,b2,b3 - all forked from Branch B) and then, they have also cherry picked these commits from their private branches to the master (with new commit-hashes, that are different from original commit hashes on the 'B' branch). So, ideally, these need not be re-merged onto the master because they already have been merged on the master (just via different route of cherry-picks).
My question is: Is there any git command that can tell me what commits from B are still pending to be merged? I really DO NOT want to see commits that have been merged to master via some other (i.e., private, b1,b2,b3) branches. I am assuming that git is smart to know that the commit despite not being directly merged, may have been merged as part of cherry picking via other multiple branches.
In this graphical scenario, I'd like git command to show me that 3 commits (c7,c8 and c9) are still pending to be merged to master.