2

We have a pre-existing SVN repository. Whoever created it did not follow the SVN standard directory structure and so there is no hooks folder.

Is there a way to tell SVN to regenerate the hooks folder? If not, is there a way to create a directory manually and configure SVN to use that folder?

TT.
  • 15,774
  • 6
  • 47
  • 88
TheChemist
  • 352
  • 2
  • 12
  • 3
    Where are you looking, exactly? Hooks don't exist inside the repository itself where you can see them from a client. They're a child of the directory created when your admin ran `svnadmin create`. The only way it's not there is if it was intentionally deleted. – alroc Jan 20 '16 at 21:14
  • As I said, this is a pre-existing repo that I did not create. I can only assume that the hooks directory was either not created or was deleted at some point. – TheChemist Jan 22 '16 at 15:22
  • Are you looking at the directory structure on the server, or only the repository contents through a client? – alroc Jan 22 '16 at 15:42

1 Answers1

2

A simple mkdir hooks should do. Be sure to give the various scripts the exec bit; and have them executable by the svn (webserver) user.

If you want to example scripts; simply do

mkdir temp-example-copy-of-repo
cd temp-example-copy-of-repo
svnadmin create repo
cd repo/hooks

to get the example templates.

Dirk-Willem van Gulik
  • 7,566
  • 2
  • 35
  • 40
  • Thanks, I think this should be good. It's a bit tough finding straightforward info about hooks. Does the folder even matter or does SNV just look through the whole repo for files with the right name (eg. post-commit)? – TheChemist Jan 22 '16 at 15:24
  • SVN doesn't look in the repository for hooks at all. They're in a separate directory outside the repository contents. – alroc Jan 22 '16 at 15:43
  • Thanks Dirk for this answer. But If I create hook locally and put a batch file in that then every other user of repository have to do the same, I guess. Also in my case,repository was created at enterprise level so no access to admin user. Is there any way I keep hook at one place which will be accessible to all?. – Purohit Hitesh Aug 23 '18 at 05:40