Subversion post commit 到标签钩子
我可以让提交后挂钩在每次有人检查某些内容时发送一封电子邮件,但是我可以限制为仅当人们将某些内容检查到标签目录中时吗?基本上我想要当有人推广版本时收到通知。我的 Subversion 在 Windows 上运行。有什么想法吗?
I can have the post commit hook send out an email every time someone checks something, but can I limit that to only if people check something into the tags directory? Basically I want a notification when anyone promotes a release. My subversion is running on Windows. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将获得作为提交后挂钩参数提交的存储库和修订版本。
使用
svnlook
获取修订中更改的文件的路径,并查看它是否有标签
并触发您的电子邮件。上面将给出看起来像
使用该信息来查看标签是否已添加并在提交后写入的行
You get the repo and revision that was committed as the arguments to the post-commit hook.
Use
svnlook
to get the path of the files changed in the revision and see if it hastags
and trigger your email.The above will give lines that look like
Use that info to see if tag was added and write you post-commit
是的,提交后脚本的第一个参数是存储库路径;在其中查找
/tags
,并且仅在找到时才发送电子邮件。Yes, the first argument to the post-commit script is the repository path; look for
<whatever>/tags
in there, and only send email if you find it.