1

I´m new to this topic and I have quite a hard time getting into programming hooks for my problem. I need a hook which can distinguish between three different user groups:

Group A: can do anything (delete tags and trunks, commit without comment) Group B: can commit to tags and delete tags/branches; CANNOT delete trunks and CANNOT commit without comment Group C: can commit to tags; CANNOT change or delete anything

Is there any way to do that?

I am very grateful for you help !

Greetings Philipp from Germany

phil9
  • 33
  • 4

1 Answers1

0

It is possible to do this. I can't write you any code, but you have to implement a pre-commit hook, and in it call svnlook to get information about the current commit.

Main information is the author of the commit, and for this you call svnlook author (see the not-accepted answer).

Another important information is what the user is changing. For this you call svnlook change, and parse the result.

To see the comment you use svnlook log.

All three calls to svnlook require the path to the repo (local path on the svn server) and the transaction ID. You get both of those as command line parameters of the pre-commit hook script

Sorting users into groups is done in the script. You can hard-code all the users there, or have a separate configuration file, as a mini-database, that the script would read. One line per user, and in the line there would be data indicating what that user can and cannot do.

Dialecticus
  • 16,400
  • 7
  • 43
  • 103