Use short SHA1 as prefixes.

Using refs as prefixes makes the diff potentially unsuitable for
patch(1) since a ref can contain forward slashes.  Use abbreviated SHA1
values.