git push failed due to false positive "leftover conflict marker"
When trying to push into felix.gruber/dune-dpg, I get the following error message:
remote:
remote: ============================================================
remote: Whitespace and / or file size errors while updating "refs/heads/master" (0000000..2272d65)
remote: Per-commit problems follow
remote:
remote: ========================================
remote: fedd594 new and detailed INSTALL instructions
remote: 3 files changed, 272 insertions(+), 83 deletions(-)
remote: ----------------------------------------
remote: fedd5946d385f67f1f169d161aa77cfec9371bce
remote: README:132: leftover conflict marker
To ssh://gitlab.dune-project.org:22022/felix.gruber/dune-dpg.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@gitlab.dune-project.org:22022/felix.gruber/dune-dpg.git'
This is due to a pre-receive hook installed on our GitLab server that checks that there are no commits which still have merge conflict markers in them.
Unfortunately, the README file in this repository contains a markdown header that looks like part of a conflict marker (=======
).
According to this mail from @ansgar on dune-devel, I am not the only one who is prevented from pushing his commits due to this over-eager pre-receive hook.
Since there will certainly be more problems caused by false positive "leftover conflict markers", I propose to remove the check for conflict markers in the pre-commit hook. According to the GitLab documentation, the pre-receive hook can only be disabled by the GitLab server administrators (I guess that would be @smuething in our case). The aforementionned documentation page says that the pre-receive hook can be found in the gitlab-shell hooks
directory. If the conflict marker check could be easily identified in the pre-receive hook script, simply commenting out this part might be the best option.