Advertisement
GarbageYard

Git pre-receive hook

Jul 17th, 2015
1,138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.76 KB | None | 0 0
  1. while read old_sha1 new_sha1 refname ; do
  2.         echo "stdin: [$old_sha1] [$new_sha1] [$refname]"
  3.         if [ "$old_sha1" == "0000000000000000000000000000000000000000" ] ; then
  4.             commits=$new_sha1
  5.         else
  6.             commits=`git rev-list $old_sha1..$new_sha1`
  7.         fi
  8.        
  9.     for commit in $commits
  10.         do
  11.             echo Commit is $commit
  12.             echo "git describe --exact-match $commit 2>&1 | grep -o fatal | wc -w"
  13.             tag=`git describe --exact-match $commit 2>&1 | grep -o fatal | wc -w`
  14.             if [ $tag -eq 0 ]; then
  15.                 echo "As this is a tag, there's no need for any validation"
  16.                 exit 0
  17.             fi
  18.             echo Tag: $tag
  19.         ...
  20.         ...
  21.         ...
  22.         done
  23. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement