SVN hooks for Windows

2019-03-07 18:57发布

I did a little googling and found that there isn't really a resource of SVN hooks for Windows. So I figured I'd start a wiki here to centralize it.

If you contribute, please be sure to indicate:

  1. The name of the hook
  2. What the script does
  3. The actual script

NOTE: I suspect posting an epic script will not be useful.

9条回答
三岁会撩人
2楼-- · 2019-03-07 19:36

This hook prevents commits to a specific branch

(branch-16E in this case):

setlocal

rem Subversion sends through the path to the repository and transaction id  
set REPOS=%1
set TXN=%2

rem Committing to a branch is not allowed
svnlook changed -t %TXN% %REPOS% | findstr "\/branch-16E"
if %errorlevel% EQU 0 goto errb else exit 0

:errb
echo. 1>&2
echo This branch was closed. If you want to commit here contact your administrator. 1>&2
exit 1
查看更多
太酷不给撩
3楼-- · 2019-03-07 19:38

I started a repository of hooks using C#. My first hook was one to send check in notices to a RSS feed: SubversionRss I'm currently working on one post-commit hook to send check in notices to a Twitter feed.

查看更多
孤傲高冷的网名
4楼-- · 2019-03-07 19:39

For the .NET developers using Subversion on Windows, Phil Haack posted about CaptainHook.

CaptainHook is a simple plugin framework for writing Subversion hooks using .NET

The project is hosted at Source Forge

查看更多
登录 后发表回答