Deal with merge commits during 'push'

Merge commits shouldn't be rebased during a push.

This also fixes how 'push' counts how many commits there are between
upstream and HEAD by using the --first-parent option in 'git log'.