[X2Go-Commits] [maintenancescripts] 04/10: git/hooks/common.sh: add umask command, verbose variable, make_boolean() function, grant() function and set GLOBIGNORE special bash variable.
git-admin at x2go.org
git-admin at x2go.org
Mon Feb 23 21:34:42 CET 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository maintenancescripts.
commit e25a06f8d7e2fcb1da8c435e4c75896724dc4f7c
Author: Mihai Moldovan <ionic at ionic.de>
Date: Mon Feb 23 21:06:04 2015 +0100
git/hooks/common.sh: add umask command, verbose variable, make_boolean() function, grant() function and set GLOBIGNORE special bash variable.
---
git/hooks/common.sh | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/git/hooks/common.sh b/git/hooks/common.sh
index 1cd8118..f973c5c 100755
--- a/git/hooks/common.sh
+++ b/git/hooks/common.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+umask 002
+
if [ "$(git rev-parse --is-bare-directory)" = "true" ]; then
GIT_REPO_NAME="$(basename "${PWD}")"
OUTSIDE_REPO="/../"
@@ -10,3 +12,30 @@ fi
# GIT_DIR will always be the current repository's .git dir.
GIT_DIR="$(pwd)"
+
+function make_boolean() {
+ OPTION="${1}"
+
+ case "${OPTION}" in
+ ("0"|"no"|""|"No"|"nO"|"NO"|"false"|"FALSE") OPTION="0";;
+ (*) OPTION="1";;
+ esac
+
+ printf "${OPTION}"
+}
+
+# If you are having trouble with any access control hook script
+# you can try setting this to true. It will tell you exactly
+# why a user is being allowed/denied access.
+# This setting may be overridden in specific scripts.
+
+verbose="1"
+
+# Default shell globbing messes things up downstream.
+GLOBIGNORE=*
+
+function grant() {
+ [ "$(make_boolean "${verbose}")" = "1" ] && echo "-Grant- ${1}" >&2
+ echo grant
+ exit 0
+}
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git
More information about the x2go-commits
mailing list