[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jgit-dev] PreReceive hook ReceiveCommand rejection messages
|
On Fri, Mar 30, 2012 at 12:37, <james.moger@xxxxxxxxxxx> wrote:
> Hi JGit Team,
>
> PreReceive rejection.
>
> receiveCommand.setResult(Result.REJECTED_OTHER_REASON, "this git server
> does not like you")
>
> I expected that the reason would be displayed client-side.
It does.
> This does
> not appear to be the case.
What version of Git? There is a bug in the C Git HTTP client that
causes errors when *all* branches fail to not display on the client. I
patched this only recently. :-(
> The JavaDoc for sendError suggests that
> setResult(result, reason) is the appropriate technique for reporting a
> rejection error message to the client. Is Gitblit doing something
> incorrect here? Should the Gitblit receive hook call sendError manually
> if a prereceive command result is one of the REJECTED enum values?
It works fine on the server. The client helpfully throws away all
error messages when there is an error.
A work-around might be to also use ReceivePack.sendError() to send an
error message to the client. This should show up on the terminal. But
there are race conditions in the client.