The driver for the ESP8266 WiFi module

Dependents:   Datarecorder2

Fork of esp8266-driver by ESP8266

Committer:
joschaihl
Date:
Wed Nov 15 20:05:03 2017 +0000
Revision:
1:aea829468cfc
Parent:
0:6946b0b9e323
test

Who changed what in which revision?

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