annotate Lib/fftw-3.2.1/.git/hooks/update.sample @ 8:fdc592312a96

Vectorised Xcorr
author Geogaddi\David <d.m.ronan@qmul.ac.uk>
date Wed, 22 Jul 2015 15:28:00 +0100
parents 25bf17994ef1
children
rev   line source
d@0 1 #!/bin/sh
d@0 2 #
d@0 3 # An example hook script to blocks unannotated tags from entering.
d@0 4 # Called by "git receive-pack" with arguments: refname sha1-old sha1-new
d@0 5 #
d@0 6 # To enable this hook, rename this file to "update".
d@0 7 #
d@0 8 # Config
d@0 9 # ------
d@0 10 # hooks.allowunannotated
d@0 11 # This boolean sets whether unannotated tags will be allowed into the
d@0 12 # repository. By default they won't be.
d@0 13 # hooks.allowdeletetag
d@0 14 # This boolean sets whether deleting tags will be allowed in the
d@0 15 # repository. By default they won't be.
d@0 16 # hooks.allowmodifytag
d@0 17 # This boolean sets whether a tag may be modified after creation. By default
d@0 18 # it won't be.
d@0 19 # hooks.allowdeletebranch
d@0 20 # This boolean sets whether deleting branches will be allowed in the
d@0 21 # repository. By default they won't be.
d@0 22 # hooks.denycreatebranch
d@0 23 # This boolean sets whether remotely creating branches will be denied
d@0 24 # in the repository. By default this is allowed.
d@0 25 #
d@0 26
d@0 27 # --- Command line
d@0 28 refname="$1"
d@0 29 oldrev="$2"
d@0 30 newrev="$3"
d@0 31
d@0 32 # --- Safety check
d@0 33 if [ -z "$GIT_DIR" ]; then
d@0 34 echo "Don't run this script from the command line." >&2
d@0 35 echo " (if you want, you could supply GIT_DIR then run" >&2
d@0 36 echo " $0 <ref> <oldrev> <newrev>)" >&2
d@0 37 exit 1
d@0 38 fi
d@0 39
d@0 40 if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
d@0 41 echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
d@0 42 exit 1
d@0 43 fi
d@0 44
d@0 45 # --- Config
d@0 46 allowunannotated=$(git config --bool hooks.allowunannotated)
d@0 47 allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
d@0 48 denycreatebranch=$(git config --bool hooks.denycreatebranch)
d@0 49 allowdeletetag=$(git config --bool hooks.allowdeletetag)
d@0 50 allowmodifytag=$(git config --bool hooks.allowmodifytag)
d@0 51
d@0 52 # check for no description
d@0 53 projectdesc=$(sed -e '1q' "$GIT_DIR/description")
d@0 54 case "$projectdesc" in
d@0 55 "Unnamed repository"* | "")
d@0 56 echo "*** Project description file hasn't been set" >&2
d@0 57 exit 1
d@0 58 ;;
d@0 59 esac
d@0 60
d@0 61 # --- Check types
d@0 62 # if $newrev is 0000...0000, it's a commit to delete a ref.
d@0 63 zero="0000000000000000000000000000000000000000"
d@0 64 if [ "$newrev" = "$zero" ]; then
d@0 65 newrev_type=delete
d@0 66 else
d@0 67 newrev_type=$(git cat-file -t $newrev)
d@0 68 fi
d@0 69
d@0 70 case "$refname","$newrev_type" in
d@0 71 refs/tags/*,commit)
d@0 72 # un-annotated tag
d@0 73 short_refname=${refname##refs/tags/}
d@0 74 if [ "$allowunannotated" != "true" ]; then
d@0 75 echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
d@0 76 echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
d@0 77 exit 1
d@0 78 fi
d@0 79 ;;
d@0 80 refs/tags/*,delete)
d@0 81 # delete tag
d@0 82 if [ "$allowdeletetag" != "true" ]; then
d@0 83 echo "*** Deleting a tag is not allowed in this repository" >&2
d@0 84 exit 1
d@0 85 fi
d@0 86 ;;
d@0 87 refs/tags/*,tag)
d@0 88 # annotated tag
d@0 89 if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
d@0 90 then
d@0 91 echo "*** Tag '$refname' already exists." >&2
d@0 92 echo "*** Modifying a tag is not allowed in this repository." >&2
d@0 93 exit 1
d@0 94 fi
d@0 95 ;;
d@0 96 refs/heads/*,commit)
d@0 97 # branch
d@0 98 if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
d@0 99 echo "*** Creating a branch is not allowed in this repository" >&2
d@0 100 exit 1
d@0 101 fi
d@0 102 ;;
d@0 103 refs/heads/*,delete)
d@0 104 # delete branch
d@0 105 if [ "$allowdeletebranch" != "true" ]; then
d@0 106 echo "*** Deleting a branch is not allowed in this repository" >&2
d@0 107 exit 1
d@0 108 fi
d@0 109 ;;
d@0 110 refs/remotes/*,commit)
d@0 111 # tracking branch
d@0 112 ;;
d@0 113 refs/remotes/*,delete)
d@0 114 # delete tracking branch
d@0 115 if [ "$allowdeletebranch" != "true" ]; then
d@0 116 echo "*** Deleting a tracking branch is not allowed in this repository" >&2
d@0 117 exit 1
d@0 118 fi
d@0 119 ;;
d@0 120 *)
d@0 121 # Anything else (is there anything else?)
d@0 122 echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
d@0 123 exit 1
d@0 124 ;;
d@0 125 esac
d@0 126
d@0 127 # --- Finished
d@0 128 exit 0