提交后挂钩遇到问题
我正在关注这个教程,就像 hello world for post-commit
我使用的是 Ubuntu 10.04。我安装了 svnnotify 并运行了 $ which svnnotify 输出:
/usr/bin/svnnotify
所以我将 turorial 中的路径从 /usr/local/bin/svnnotify
更改为 /usr/bin/svnnotify
我也尝试更改该行:将 #!/bin/sh
更改为 #!/bin/bash
,因为 bash 是 ubuntu 10.04 中的登录 shell。
我尝试按照教程最初的方式运行它,进行我的更改以及两者的组合。
每次提交成功但我得到
警告:提交后挂钩失败(退出代码 1),没有输出。
原来的方式有输出 not found
我对 linux 和 shell 脚本非常陌生,并且已经用尽了我能想到的一切。我做错了什么?
I am following this tutorial that is like the hello world for post-commit
I am using Ubuntu 10.04. I installed svnnotify
and ran $ which svnnotify
which output:
/usr/bin/svnnotify
so I changed the path in the turorial from /usr/local/bin/svnnotify
to /usr/bin/svnnotify
I also tried changing the line: #!/bin/sh
to #!/bin/bash
since bash is the login shell in ubuntu 10.04.
I tried to run it the way the tutorial originally had it, with my changes, and combinations of the two.
Every time the commit is successful but I get
Warning: post-commit hook failed (exit code 1) with no output.
The original way had output not found
I am very new to linux and shell scripting and have exhausted everything I can think of. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在尝试作为提交挂钩运行之前,让脚本正常工作并进行测试。我希望你的问题与脚本有关,可能没有被标记为可执行文件,环境错误等。即,如果你无法让它从命令行成功运行,这更像是一个unix/shell问题并且与 SVN 没有任何关系(还)。
Get the script working and tested before trying to run as a commit hook. I expect that your problem is something to do with the script, maybe not being marked as executable, environment wrong, etc.. i.e. if you can't get it to run successfully from the command line, this is more of a unix/shell question and doesn't really have anything to do with SVN (yet).
我不确定这是否适用于 Linux 世界,但在我使用的 Windows 版本的 SVN 中,运行钩子脚本的代码仅捕获 STDERR。如果您的挂钩脚本仅将消息写入 STDOUT,则可能会解释“无输出”警告。
I'm not sure whether this applies in the Linux world, but in the Windows versions of SVN I've used, the code which runs the hook scripts only captures STDERR. If your hook script is only writing messages to STDOUT, that would likely explain the "No Output" warning.