From 04367af3e86b518170bb96513c15ba590097e8fe Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 25 May 2012 11:17:25 +0530 Subject: [PATCH] Revert "simulate POST_CREATE for newly created "normal" repos" This reverts commit bc3eb3421171a432aa62d784709d0b0e319de183. --- src/triggers/new-normal-repos | 55 ----------------------------------- 1 file changed, 55 deletions(-) delete mode 100755 src/triggers/new-normal-repos diff --git a/src/triggers/new-normal-repos b/src/triggers/new-normal-repos deleted file mode 100755 index 7e66509..0000000 --- a/src/triggers/new-normal-repos +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -# run some command on every new repo created via the conf file -# ---------------------------------------------------------------------- - -# BACKGROUND -# The POST_CREATE trigger (see doc/triggers.mkd) only works for repos that a -# user creates (see doc/wild.mkd). It does NOT work for repos created -# normally using the conf file. The POST_COMPILE trigger sequence should -# normally be used to trigger anything to happen after a compile. -# -# I have not seen a sane use case for a POST_CREATE trigger when a new repo -# is created via the conf file. (I do not consider "all new repos should -# have a default set of branches" to be a sane requirement). However, on -# the off-chance that something turns up at some future time, here's how you -# can do this without touching the core gitolite code. - -# INSTRUCTIONS FOR USE -# - (optional) rename this to whatever you want -# - change the 'post_create_normal' function below to do whatever you want it -# to do, or make it call some other command to do it -# - make the script executable -# - add 'new-normal-repos' (or whatever you renamed it to) to the PRE_GIT and -# the POST_COMPILE trigger lists in the rc file - -post_create_normal() { - echo "post_create_normal called with repo '$1'" >&2 -} - -# tempfile prefix; if you really care, change this also, otherwise leave it alone -tfp=$HOME/.tmp.$GL_USER.list-repos - -# ---------------------------------------------------------------------- - -if [ "$1" = "PRE_GIT" ] -then - # unless someone is pushing to the admin repo, we don't care - [ "$2" = "gitolite-admin" ] || exit 0 - [ "$4" = "W" ] || exit 0 - - # save the list of repos - gitolite list-repos > $tfp.1 -elif [ "$1" = "POST_COMPILE" ] -then - # get the new list of repos and compare with the one PRE_GIT created - gitolite list-repos > $tfp.2 - for repo in `grep -x -f $tfp.1 -v $tfp.2` - do - - post_create_normal "$repo" - done -else - # if you edited your rc file correctly, this line should never be reached - echo "ignoring call to" `basename $0` "with arg1 = '$1'" >&2 -fi