]> Cypherpunks.ru repositories - nncp.git/blobdiff - doc/git-bundler.sh
Yet another git-related exec-handler example
[nncp.git] / doc / git-bundler.sh
diff --git a/doc/git-bundler.sh b/doc/git-bundler.sh
new file mode 100755 (executable)
index 0000000..70df771
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh -ex
+
+tmp=$(mktemp)
+
+cleanup()
+{
+    rm -f $tmp
+}
+trap cleanup HUP PIPE INT QUIT TERM EXIT
+
+read revs
+cd $HOME/git/$1.git
+git bundle create $tmp $revs
+nncp-file -nice $NNCP_NICE $tmp $NNCP_SENDER:$1-$(date '+%Y%M%d%H%m%S').bundle