#!/bin/sh for i in $(git push -n $* 2>&1 \ | awk '$1 ~ /[a-f0-9]+\.\.[a-f0-9]+/ { print $1; }') do git log --oneline $i done