summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Jacquin (Beber) <beber.mailing@gmail.com>2006-04-26 00:53:10 +0200
committerbeber <beber@meathook.melee>2006-04-26 00:53:10 +0200
commit2b0161cdc2d8551a5ec349a525cfdc05dedf8470 (patch)
tree97a11d4310184b63736fb025b67d73dfe22c4210
parentReeable mode change in hooks (diff)
downloadperso-2b0161cdc2d8551a5ec349a525cfdc05dedf8470.tar.gz
git hooks: misc update
-rwxr-xr-xgit/hooks/pre-update6
-rwxr-xr-xgit/hooks/update13
2 files changed, 9 insertions, 10 deletions
diff --git a/git/hooks/pre-update b/git/hooks/pre-update
index 195e456..669219e 100755
--- a/git/hooks/pre-update
+++ b/git/hooks/pre-update
@@ -6,6 +6,6 @@
# 2664 for files
# 2775 for reps
# owned by git group
-sudo find refs objects info -type d -exec chmod 2775 {} \;
-sudo find refs objects info -type f -exec chmod 2775 {} \;
-sudo find refs objects info -exec chown apache:git {} \;
+sudo find refs objects info -type d \! -perm 2775 -exec chmod 2775 {} \;
+sudo find refs objects info -type f \! -perm 2775 -exec chmod 2775 {} \;
+sudo find refs objects info \! -user apache -exec chown apache:git {} \;
diff --git a/git/hooks/update b/git/hooks/update
index ae66794..cf92708 100755
--- a/git/hooks/update
+++ b/git/hooks/update
@@ -18,7 +18,7 @@ gitweburl="http://guybrush.ath.cx/gitweb" # Git web URL, can be empty if no gitw
maintainer="beber.mailing@gmail.com" # Maintainer email for bugs reports, can be empty too
mailprefix="Melee:" # Prefix for mail
smtpserver="localhost" # SMTP server address (default is localhost)
-mailonlyforrefs=( "master" ) # Track and send mail for only theses refs. It can be multiple (ex: mailonlyforrefs=( "master" "upstream" )
+mailonlyforrefs=( "master" "pr/my_passwd" ) # Track and send mail for only theses refs. It can be multiple (ex: mailonlyforrefs=( "master" "upstream" )
export TERM=dumb
export LC_ALL=C
@@ -60,7 +60,6 @@ fi
# Change /var/git to your need
gitrepopath=$(pwd)
gitrepopath=${gitrepopath#/var/git/}
-gitrepopath=${gitrepopath%.git}
gitrepopath=${gitrepopath#public/} # public/private are just here for MY need, you can delete this
gitrepopath=${gitrepopath#private/}
@@ -76,7 +75,7 @@ nb_refs_to_check=${#mailonlyforrefs[@]}
while [ ${nb_refs_to_check} -ne 0 ]; do
# Bash start table at 0, so we start from the end - 1
nb_refs_to_check=$((${nb_refs_to_check}-1))
-
+
if [ "${updateref/refs\/heads\//}" = "${mailonlyforrefs[${nb_refs_to_check}]}" ]; then
ok_for_mail=1
fi
@@ -84,7 +83,7 @@ done
if [ -z "${ok_for_mail}" ]; then
# Don't mail for that refs, quit
- echo "Don't mail for that refs, quit ($mailonlyforrefs)" >> ${log}
+ echo "Don't mail for head ${updateref}, quit ($mailonlyforrefs)" >> ${log}
exit 0
fi
@@ -115,8 +114,8 @@ do
echo "Update in $(pwd)/${updateref}" >> ${mailfile}
if [ ! -z "${gitweburl}" ]; then
- echo "${gitweburl}/?p=${gitrepopath}.git;a=summary" >> ${mailfile}
- echo "${gitweburl}/?p=${gitrepopath}.git;a=commit;h=${id_to}" >> ${mailfile}
+ echo "${gitweburl}/?p=${gitrepopath};a=summary" >> ${mailfile}
+ echo "${gitweburl}/?p=${gitrepopath};a=commit;h=${id_to}" >> ${mailfile}
echo >> ${mailfile}
fi
@@ -125,7 +124,7 @@ do
echo "---" >> ${mailfile}
echo >> ${mailfile}
- cg diff -r ${id_from}..${id_to} | git apply --stat --summary >> ${mailfile}
+ cg diff -r ${id_from}..${id_to} | git apply --stat --summary >> ${mailfile}
echo >> ${mailfile}
cg diff -r ${id_from}..${id_to} >> ${mailfile}