Display output from pre-receive scripts
Since !18646 (merged) we show only generic error message when merge fails. The reason is to make sure we do not expose any not-sanitized/sensitive output to users.
A drawback is that more detailed error message might be important in some cases, one of use-cases (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18646#note_81240465):
... So I made a pre-receive hook which has some kind of access control over files. I check this only during MR (when refname = 'refs/heads/master'). When user has insufficient permission to edit the file, I exit the pre-receive hook with status 1. Before I was able to send some error message on STDOUT which was displayed in MR infobox on gitlab: Now that there is no such way of doing this, I have some other options: - send an email to MR author containing explanation - comment on MR with explanation of why it failed I chose the latter option, commenting on MR itself. But this was harder than I thought since ...
Perhaps we could find a way how to display only a sanitized message? Or maybe we could check for a message pattern, e.g. we would check if error output of pre-receive hooks contain "USER_MESSAGE: some message to display" - and we would display only this output?