Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#3872 assigned infra

Add hook to stop merge commits into the master repository

Reported by: Amar Takhar Owned by:
Priority: normal Milestone: Indefinite
Component: admin Version:
Severity: normal Keywords: git, server, need-funding
Cc: Blocked By: #4790
Blocking:

Description (last modified by Amar Takhar)

A developer had an issue where they accidentally pushed local code that generated a 'merge commit'.

It's been suggested a hook be added to the server side repository to stop this from happening.

Here is one such hook I'll have to test it out before adding it:

https://stackoverflow.com/questions/2039773/have-remote-git-repository-refuse-merge-commits-on-push

I will also add:

[receive]
    denyNonFastForwards = true
    denyDeletes = true

To the main repo to block any accidental --force pushes. If we are blocking merge commits it makes sense to block this as well.

Change History (3)

comment:1 Changed on 02/13/20 at 18:21:44 by Amar Takhar

Description: modified (diff)

comment:2 Changed on 02/14/20 at 04:20:23 by Chris Johns

Sounds great, many thanks.

comment:3 Changed on 01/19/23 at 17:26:21 by Amar Takhar

Blocked By: 4790 added
Keywords: need-funding added
Milestone: Indefinite

This is an option in Gitlab.

Note: See TracTickets for help on using tickets.