wifi test

Dependencies:   X_NUCLEO_IKS01A2 mbed-http

Committer:
JMF
Date:
Wed Sep 05 14:28:24 2018 +0000
Revision:
0:24d3eb812fd4
Initial commit

Who changed what in which revision?

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