From 0ef545513bc77af8f8c6136f6c09fdfe245bb404 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Mon, 22 Dec 2008 21:10:01 -0600 Subject: [PATCH] Add some weak docs and samples for server-side hook install. --- README.markdown | 12 +++++++++++- server/post-receive.sample | 11 +++++++++++ server/update.sample | 5 +++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 server/post-receive.sample create mode 100644 server/update.sample 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 + -- 2.39.5