ubuntu svn post commit钩子不起作用,但是可以手动运行 [英] ubuntu svn post commit hook does not work, but works on manual running

查看:218
本文介绍了ubuntu svn post commit钩子不起作用,但是可以手动运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

/usr/bin/svn update /var/project2_test/debug --username XXXX--password XXXX
/bin/echo $REV >> /var/project2_test/svn.log

提交时日志已更新.但是工作副本永远不会更新. 我手动运行/home/admin/svn/project/hooks/post-commit.可以!

the log has been updated while committing. but working copy never update. And I run /home/admin/svn/project/hooks/post-commit by hand. IT WORKS!

推荐答案

  1. 提交后挂钩(实际上是任何挂钩)
    • 在空旷的环境中运行
    • 在另一个用户凭据下运行,而不是手动运行(已使用SVN服务器的用户)
  1. Post-commit hook (any hook really)
    • running in empty environment
    • running under another user credentials, than on running by hand (user of SVN-server used)
  • 拦截update命令的输出(通过将stdout重定向到stderr)
  • 将此输出显示给用户,执行提交,即因为仅在钩子发生错误时将stderr编组给用户,所以您必须使用非零退出代码退出钩子
  • Intercept output of update command (by redirecting stdout to stderr)
  • Show this output to user, which perform commit, i.e, because stderr marshalled to user only in case of error in hook, you have to exit hook with non-zero exit-code

调试阶段的钩子就像

/usr/bin/svn update /var/project2_test/debug --username XXXX --password XXXX > &2
/bin/echo $REV >> /var/project2_test/svn.log
exit 1

这篇关于ubuntu svn post commit钩子不起作用,但是可以手动运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆