Display error message from PreReceive Plugin in File Edit Mode

I am currently updating our custom, in-house plugin to check commit messages for issue IDs of a legacy system to the new Repository Hook API.

Especially the possibility to also reject commits from the File Edit Mode in the Browser is an awesome feature to have.

But: It seems that the reasons for rejecting a commit are not displayed in the GUI. When doing a commit/push from git, I can clearly see the error message in the log of git, but when doing it in the browser, I only get a message about how I don’t have permission to edit the branch. My actual reason for rejecting the commit is nowhere to be seen.

I followed this guide, creating a callback with the “added_to_repository” filter and the new RepositoryHookResult etc.

But still, I only get a useless, default error message What am I doing wrong?

Hi Florian,

You are not doing anything wrong. Bitbucket server currently doesn’t display the veto message provided by the RepositoryHook. I have created a issue for this. Please add yourself as a watcher to the issue.

Thanks,
Justin Thomas
Bitbucket Server

1 Like

Oh man… I was so excited about this feature and it’s only half implemented… Ah well. Thanks for the Issue link, I’ll hope it will be implemented soon.