commit钩子发送消息给客户端

commit钩子发送消息给客户端

本文介绍了SVN post-commit钩子发送消息给客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写在bash后提交脚本,我想传递消息回谁在作出承诺的客户端。然而

I'm writing a post-commit script in bash, and I'd like to pass messages back to the client who's making a commit. However

echo my message >&2

不使它返回给客户端。它甚至有可能将消息发送回一个post-commit钩子?

isn't making it back to the client. Is it even possible to send messages back with a post-commit hook?

推荐答案

Condering一个的做:

Condering a post-commit hook does:

任何输出到stderr的钩子将被编组回客户端,使其更容易诊断钩子的失败。

您可以检查,如果这不是一个简单的问题帖:

you can check if this isn't a simple quote issue:

echo "my message" >&2

您可以在那些钩范例任何回声>&安培; 2 包括引号

You can see in those hook examples that any echo to >&2 includes quotes.

在重定向的还包括与报价的例子。

The bash chapter on redirection also includes examples with quotes.

然而,如在的细节=htt​​p://stackoverflow.com/a/8427369/ 6309的,除非脚本的退出状态由0不同,使用中所示的标准错误信息将不可见=htt​​p://serverfault.com/a/386219/ 783>颠覆post-commit钩子:打印错误的信息,即用户可以看到

However, as pmod details in his answer, that stderr message won't be visible unless the exit status of the script differs from 0, as illustrated in "subversion post-commit hook: print an error message that the user can see?"

#!/bin/bash
echo "test" >&2
exit 1

这篇关于SVN post-commit钩子发送消息给客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 16:14