Makistos
10/28/2013 - 7:57 AM

This script can be added to one of the git's hooks (e.g. post-receive) to list all the SHA's of the commits being done. #git #git-hook #stdi

This script can be added to one of the git's hooks (e.g. post-receive) to list all the SHA's of the commits being done. #git #git-hook #stdin #sha #bash #scm

#!/bin/sh

while read ref
do
  case "$ref" in
    *refs/tags/* )
      sha=`echo $ref | cut -d " " -f 2`
      echo "$sha"
      ;;
    *           )
      ;;
  esac
done