In git, one can use the following command to get a list of branch commits for some branch, xxxx, that have not been merged into master:
git rev-list xxxx --not master
For example, if there are 3 commits in branch xxxx, you will get a list of 3 hashes on 3 lines:
$ git rev-list xxxx --not master
<hash1>
<hash2>
<hash3>
If I merge this branch into master, however, I can no longer retrieve this list of hashes with the same command; I get an empty list, because the commits are now in master.
I was wondering if anyone out there has a command that can generate this list post-merge. Preferably, the command would work in the same manner whether or not the commits had been merged to master.
The following essentially does the trick:
git rev-list xxxx --not <hash3>^
However, I want to use this in a script, and I don't want to have to provide <hash3>
as an argument - I need to find it programmatically.