views:

21

answers:

1

I'm having a hard time getting a hook to run either on initial clone (this does not seem possible since the hooks don't get cloned anyhow) or on a simple pull.

I'm using git to manage a number of config files, and I need to maintain proper file ownership and perms. In my main repo, I have commit hooks set to call the "setgitperms.pl" script, and this works fine for getting the files into the repo and keeping track of the perms. The .gitmeta file gets checked out on the initial clone I run on a new box.

My problem is that I can find no git action to run after the clone that will trigger any hook. Ideally, I'd like some kind of no-op that I could run to call a hook. For example, if I could tell someone to run a sequence of commands like this to check out the repo and end up with a working copy that has the right perms, I'd be happy:

git clone git@netinstall:/var/gitrepo/conf/base.conf
cd base
tar xvzpf hooks.tgz (hooks tarball is in the repo)
git ???? - something that magically calls a hook with setgitperms 

I've totally been running around in circles on this one. Any ideas?

A: 

Why does it need to be invoked through a hook? Can you just call setgitperms.pl directly after doing the clone?

mkarasek
I'd prefer for it to be automatic. I wasn't sure where best to post this - Git is more for programmers, but I'm trying to shoehorn it into config management for /etc and /usr/local/etc, both of which require strict permissions checking.
sporker