Git alias:
commit-is-merge = !"f(){ \ [ -n \"$(git commit-parents \"$*\" | sed '0,/^parent /d')\" ]; \ };f"
Example:
git commit-is-merge && do-something || do-something-else