Created
November 15, 2012 12:23
-
-
Save lehnerpat/4078395 to your computer and use it in GitHub Desktop.
Script to replace full shas with shorter versions (arbitrary length)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git log --format=">%H< %cN" -10 | while read line | |
do | |
pre=`echo $line|sed -e "s/\(.*\)>[^<]*<.*/\1/"` | |
sha=`echo $line|sed -e "s/.*>\([0-9a-fA-F]*\)<.*/\1/"` | |
#echo "Cut sha as: $sha" | |
sha=`git rev-parse --short=4 $sha` | |
rest=`echo $line|sed -e "s/.*>[^<]*<\(.*\)/\1/"` | |
echo "$pre -- $sha -- $rest" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment