[llvm-dev] [monorepo] Pre-push hook to prevent pushing merge commits

Roman Lebedev via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 9 11:40:37 PST 2018


On Fri, Nov 9, 2018 at 10:33 PM Louis Dionne via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> Hi,
>
> At the LLVM dev meeting, some people discussed the possibility of having pre-push and/or pre-commit hooks to avoid messing up the history when we move on to the monorepo. One of the concerns was about people starting to push merge commits and unsquashed commits upstream, resulting in a messy history.
>
> I had volunteered to write a hook that would check for the absence of merge commits in the set of commits being pushed upstream, which I did. The hook is available here: https://gist.github.com/ldionne/2c260ce2081db74206e074e09cff71d0.
>
> If there is any interest for something like this, the code’s there.
I would like to note that it is a client-side hook. So every one would
need to install it.
To be actually able to prevent such things, it needs to be
centralized, server-side hook.
(I don't think you can have server-side hooks on github, so if that is required,
the master (as in, not a mirror, but the one you commit things into)
git monorepo can't be located on github..)

> Cheers,
> Louis
Roman.

> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list