summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-12-28 23:06:11 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-12-28 23:06:11 (GMT)
commitbfce8e9765d4aafca6e3ec0f854c380b3b79db1c (patch)
treef009d47f56f1971210b2b12c5ce97876028374c9
parent05a51fa546a42560f505eacbbc1f01a809e5c5b8 (diff)
downloadmisc-bfce8e9765d4aafca6e3ec0f854c380b3b79db1c.zip
misc-bfce8e9765d4aafca6e3ec0f854c380b3b79db1c.tar.gz
misc-bfce8e9765d4aafca6e3ec0f854c380b3b79db1c.tar.bz2
censorgit/post-receive: post-receive hook for updates through "cg"
-rwxr-xr-xcensorgit/post-receive25
1 files changed, 25 insertions, 0 deletions
diff --git a/censorgit/post-receive b/censorgit/post-receive
new file mode 100755
index 0000000..e2a28a6
--- /dev/null
+++ b/censorgit/post-receive
@@ -0,0 +1,25 @@
+#!/bin/sh
+REPO_BASE=`pwd`/..
+BIN=$REPO_BASE/../bin
+SRC=`pwd`
+DST=$REPO_BASE/ee-feeder
+CG=$BIN/cg
+
+unset GIT_DIR
+
+changed=false
+while read oval nval ref; do
+ [ "$ref" = refs/heads/master ] || continue
+ logger "post-receive: $oval $nval $ref"
+
+ GIT_COMMITTER_NAME="Generated from internal repo" \
+ GIT_COMMITTER_EMAIL="nobody@neo900.org" \
+ $CG --bare --exclude="**/*.kicad_pcb" \
+ "$SRC" "$DST" $oval..$nval
+ changed=true
+done
+
+if $changed; then
+ cd "$DST"
+ git push
+fi