使用 SVN 管理 SVN 挂钩?
据我所知,SVN 本身没有内置功能来管理 SVN 挂钩。当然有一些想法,例如另一个带有钩子脚本的存储库,在提交时运行 svn export
到 hooks
目录,但你会怎么做呢?
As far as I could see, there is no built-in feature to manage SVN hooks in SVN itself. There are some ideas of course, such as another repository with hooks scripts, running an svn export
to the hooks
directory on commit, but how would you do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的一个存储库中有由 SVN 管理的钩子。但这不是同一个存储库;我创建了第二个 SVN 存储库来保存第一个存储库的挂钩。我担心错误的提交会破坏对主存储库的访问。
I've got hooks managed by SVN in one of my repositories. This is not the same repository though; I've created second SVN repository to hold hooks for the first one. I was worried about breaking access to the main repo with a faulty commit.
我认为将 hooks 目录设置为 subversion checkout 并没有什么问题。因此,在提交钩子之后,您只需在钩子目录中
svn up
,作为提交后操作。我认为它还应该使 hooks 目录成为它正在管理的存储库的签出目录。
I think there is nothing wrong with making the hooks directory a subversion checkout. So after committing the hook, you merely have to
svn up
in the hooks directory, as the post-commit action.I think it should also work to make the hooks directory a checkout of the very repository it is managing.