Question

I have an SVN repository and I need the commits to fail if no description is entered. Is this possible to do, preferably server-side? (The users use several different tools for interacting with the repository; although if this were possible client-side in TortoiseSVN, that would alleviate the problem)

Google has not been very helpful, can you give me some pointers?

Thanks.

Was it helpful?

Solution

Yup, you'll want to write a pre-commit hook in the repository which fails with an appropriate error message to send back to the client.

If you look in the "hooks" directory of a freshly created repository, you'll find a pre-commit.tmpl file. That contains instructions, and the sample even checks that the log message contains text - just what you want.

So, you should be able to rename pre-commit.tmpl to pre-commit and make it executable, then give it a whirl. I suggest you try it on a sandbox repository before a production one though, to avoid angry users being unable to commit while you get it right :)

OTHER TIPS

You can do that using repository hooks. In your case, you want a pre-commit hook that will check the message and reject the commit if it is empty.

The FreeBSD project has some examples you may want to use. See the public svn repo with hooks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top