You need to sign in or sign up before continuing.
Handle custom Git hook result in GitLab UI
Overview
The GitLab merge request UI should handle the returned result from a custom Git hook when a MR merge is attempted.
Reproduce
- Configure a custom project Git hook
This will reject any push to master which has any non-linear history
oldrev="$2"
newrev="$3"
merge_commit=$(git rev-list -n 1 --merges $oldrev..$newrev)
if [ -n "$merge_commit" ]; then
echo "Merge commit detected: $merge_commit";
exit 1
fi
- Create a new merge request that will be rejected due to non-linear history (contains a merge from another branch)
- Accept this merge request via the GitLab UI
Actual
- "Something went wrong during merge" is displayed when accepting the MR.
Expected
- Output of why the merge failed. eg. "Failed due to pre-receive hook" include hook output?
cc// @stanhu