Common Types of Subversion Hooks

前端 未结 16 2056
無奈伤痛
無奈伤痛 2020-11-28 04:01

What kinds of hook scripts are people using for Subversion? Just general ideas but code would be great too!

相关标签:
16条回答
  • 2020-11-28 04:43

    We check the following with our hook scripts:

    • That a commit log message has been supplied
    • That a reviewer has been specified for the commit
    • That no automatically generated code or banned file types land up in the repository
    • Send an email out when a branch / tag is created

    We still want to implement the following:

    • Send an email when a user acquires a lock on a file
    • Send an email when your lock has been stolen
    • Send an email to everyone when a revision property has been changed
    0 讨论(0)
  • 2020-11-28 04:44

    If you have a mix of unix and Windows users working with the repository, I urge you to use the case-insensitive.py pre-commit hook-script as a precautionary measure. It prevents hard-to-sort-out situations where svn updates fail for Windows users because of a file rename which only changed the case of the file name. Believe me, there is a good chance it will save you trouble.

    0 讨论(0)
  • 2020-11-28 04:45

    For those who are looking for a pre-revprop-change.bat for a snvsync operation :

    https://gist.github.com/1679659

    @ECHO OFF
    
    set user=%3
    
    if /I '%user%'=='syncuser' goto ERROR_REV
    
    exit 0
    
    :ERROR_REV echo "Only the syncuser user may change revision properties" >&2
    exit 1
    

    It just comes from here : http://chestofbooks.com/computers/revision-control/subversion-svn/Repository-Replication-Reposadmin-Maint-Replication.html and has been adapted for Windows.

    0 讨论(0)
  • 2020-11-28 04:46

    I forgot to enter a comment while committing. Didn't have time to figure out why my pre-revprop-change hook wasn't working. So the following svnadmin command worked for me to enter a commit message: svnadmin setlog <filesystem path to my repository> --bypass-hooks -r 117 junk, where "junk" is the file containing the text which I wanted to be the comment. svn setlog help has more usage info...

    0 讨论(0)
提交回复
热议问题