You can achieve this by piping git cherry
output through two more commands:
First use sed
to remove the +
at the start of each line to leave the raw commit IDs:
$ git cherry master dev | sed 's/^+ //'
54408ddc6403376c638d5bfc94c033ab655da7b3
68bc4277954b7de4c95881904de22f1d443366ae
d74ab86eee75a8e5c1a835a6e69e74c01d4186e8
Now use xargs --max-lines=1
to pass each commit ID to git log -1
, which can then display other information about each commit:
$ git cherry master dev | sed 's/^+ //' | xargs --max-lines=1 git log -1 --pretty=format:"%h [%ad] %an : %s" --date=short
54408dd [2013-10-09] Robin Winslow : Update Binaries submodule
68bc427 [2013-10-09] Robin Winslow : Update reference dependencies for Website
d74ab86 [2013-10-09] Robin Winslow : Remove non-exisent files from Website project
Note: You can tailor the --pretty=format:"%h [%ad] %an : %s" --date=short
part to get whatever output you like from git log