On Sun, May 24, 2009 at 10:33:25PM +0200, Jim Meyering wrote: > Davi Leal wrote: > > Sylvain Beucler wrote: > >> In addition, Davi Leal of the gnuherds project would like the cia and > >> email-on-commit hooks. Can you enable them? > > > > IMHO it should not be needed to contact to the Savannah administrators to > > enable these features. It should be possible enable it directly in the > > Savannah webapp. > > > > > > I should add a task ticket to record this feature request so that we can > > follow improving Savannah. You can assign it to me, and I will work out it > > when I can: 6 or 7 months. > > > > I will join the Savannah-Hackers project so I can be assigned this task. > > Hi Sylvan, > > I wrote this Makefile: > > dest_dir= /usr/local/bin > gprh = git-post-receive-hook > > all: > > # The cvt-* targets are to convert symlinks that point into /srv/git/hooks > # so that they point instead at the scripts now installed in $(dest_dir). > cvt-links-cia: > find /srv/git/*.git/hooks -printf '%p %l\n' \ > | sed -n 's, /srv/git/hooks/git-cia,,p' \ > | xargs --no-run-if-empty -i -n 1 sh -c 'f={}; chattr -i $$(dirname > $\ > $f); ln -sf $(dest_dir)/git-cia $$f; chattr +i $$(dirname $$f)' > > cvt-links-pr: > find /srv/git/*.git/hooks -printf '%p %l\n' \ > | sed -n 's, /srv/git/hooks/post-receive,,p' \ > | xargs --no-run-if-empty -i -n 1 sh -c 'f={}; chattr -i $$(dirname > $\ > $f); ln -sf $(dest_dir)/$(gprh) $$f; chattr +i $$(dirname $$f)' > > install: > install git-cia $(dest_dir) > install post-receive $(dest_dir)/$(gprh) > -------------------
Shell script within xargs within Makefile - argh my eyes!! I have 2 general considerations: - I foster the use of runscripts and *.d directories (e.g. gsl.git/hooks/post-receive.d). This allows combining several scripts, and also avoids messing with chattr +/- i everytime. - We need to _document_ all this. More and more things are piling up in the Git setup and I'm not sure anybody knows how things need to be extended. -- Sylvain