0

gerritにフックを使用していますか?パッチセットをスキャンするために1つ必要です。

の下に更新フックを作成しようとしましGIT_DIR/hooks/たが、gerritはマージ時にそのフックをバイパスしますが、gitに直接プッシュすると機能します。次にgerrit_site/hooks/patchset_created+x権限で作成しようとしました。''のようなerror_logを見ることができますecho $GIT_DIRが、メッセージはsshターミナルのようなユーザーインターフェイスにリダイレクトできません。また、0と1を終了しても、プッシュはブロックされません。

gerritフックがgitフックとして機能し、メッセージをユーザーにリダイレクトしてパッチセットをブロックすることは可能ですか?

4

2 に答える 2

1

Is it possible for the gerrit hook acts as git one which can redirect message to user and block some patchset?

No. Gerrit hooks cannot block action and cannot redirect output back to the user. They run post-action, so the action is already done by the time the hook is called. See the official documentation at http://gerrit-documentation.googlecode.com/svn/Documentation/2.4.2/config-hooks.html

Adding pre-commit hooks is being worked on currently and will be available in future versions of Gerrit, likely as a plugin.

The best current option is to create a Gerrit hook which scans the patchset like you describe and then comments on the change in Gerrit using the ssh interface. At $dayjob, we use such a hook to give a -2 review score automatically to patches with commit messages which don't meet our standards.

于 2012-09-07T14:50:25.897 に答える
0

文書化されていないようで、まだ自分でテストしていませんが、ref-update (ref-updated からの d なし) フックは、あなたにふさわしいことをしているようです: https://gerrit-review.googlesource.com/#/ c/31350/

于 2013-02-04T18:50:08.160 に答える