Permalink
Browse files

Add some weak docs and samples for server-side hook install.

  • Loading branch information...
1 parent 997505f commit 0ef545513bc77af8f8c6136f6c09fdfe245bb404 @stephenh committed Dec 23, 2008
Showing with 27 additions and 1 deletion.
  1. +11 −1 README.markdown
  2. +11 −0 server/post-receive.sample
  3. +5 −0 server/update.sample
View
@@ -58,9 +58,19 @@ Bootstrapping Scripts
[15]: master/scripts/create-gitconfig
[16]: master/scripts/create-stable
+Install Server-side Hooks
+=========================
+
+* Download/clone the `gc` repo to something like `/srv/git/gc`
+* Edit `your_repo.git/hooks/post-receive` and `your_repo.git/hooks/update` to call the `gc` hooks as appropriate
+ * [post-receive.sample][17] and [update.sample][18] are good templates to use for calling multiple hooks
+
+[17]: master/server/post-receive.sample
+[18]: master/server/update.sample
+
Todo
====
* Install approach for scripts
-* Install documentation for hooks
+* Install for client hooks
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+nl=$'\n'
+input=""
+while read newref oldref refname ; do
+ input="$input$newref $oldref $refname$nl"
+done
+
+echo -n "$input" | /srv/git/gc/server/post-receive-one
+echo -n "$input" | /srv/git/gc/server/post-receive-two
+
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+/srv/git/gc/server/update-one $1 $2 $3 &&
+/srv/git/gc/server/update-two $1 $2 $3
+

0 comments on commit 0ef5455

Please sign in to comment.