From: Stephen Haberman Date: Tue, 23 Dec 2008 03:10:01 +0000 (-0600) Subject: Add some weak docs and samples for server-side hook install. X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0ef545513bc77af8f8c6136f6c09fdfe245bb404;p=git-central.git Add some weak docs and samples for server-side hook install. --- diff --git a/README.markdown b/README.markdown index e8afad7..30367f8 100644 --- a/README.markdown +++ b/README.markdown @@ -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 diff --git a/server/post-receive.sample b/server/post-receive.sample new file mode 100644 index 0000000..bb2fc2d --- /dev/null +++ b/server/post-receive.sample @@ -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 + diff --git a/server/update.sample b/server/update.sample new file mode 100644 index 0000000..6176b99 --- /dev/null +++ b/server/update.sample @@ -0,0 +1,5 @@ +#!/bin/sh + +/srv/git/gc/server/update-one $1 $2 $3 && +/srv/git/gc/server/update-two $1 $2 $3 +