From cb9a75f74657b43f2ea42537f4584488b658c04b Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Thu, 8 Jan 2009 11:34:59 +0100 Subject: [PATCH] Post-receive will generate gitweb links. --- id-new-project/post-receive-email-id | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/id-new-project/post-receive-email-id b/id-new-project/post-receive-email-id index 6f87ac7..114d613 100644 --- a/id-new-project/post-receive-email-id +++ b/id-new-project/post-receive-email-id @@ -59,6 +59,7 @@ # - generate_delete_XXXX_email # - generate_email_footer # + generate_email() { # --- Arguments @@ -374,6 +375,8 @@ generate_update_branch_email() if [ -z "$rewind_only" ]; then echo "Revisions details." echo "" + generate_gitweb_link + echo "" echo $LOGBEGIN git rev-parse --not --branches | grep -v $(git rev-parse $refname) | git rev-list --pretty --stdin $oldrev..$newrev @@ -569,6 +572,20 @@ generate_delete_general_email() echo $LOGEND } +GITWEB_PUB="http://git.indexdata.com" +GITWEB_PRIV="https://gitid.indexdata.com" + +generate_gitweb_link() +{ + proj_path=`pwd` + proj_dir=`basename $proj_path` + gitweb_host=$GITWEB_PUB + if echo "$proj_path" | grep -q "private" + then gitweb_host=$GITWEB_PRIV + fi + echo "$gitweb_host/?p=$proj_dir;a=commitdiff;h=$newrev" +} + # ---------------------------- main() # --- Constants -- 1.7.10.4