Skip to content
Snippets Groups Projects
  1. Oct 12, 2021
    • Karel Koci's avatar
      githooks/pre-push: allow fast-forward of master to develop · 0f4d5e65
      Karel Koci authored
      The original check was that master can be pushed only with develop
      branch. It is what we mostly want but there are cases when we do not
      update develop and only master that are valid as well. The example of
      such operation is merge of develop to master, which is always
      fast-forward due to our workflow.
      
      This halts push only if master commit is not ancestor of develop instead
      of halting it always when develop is not being updated.
      Verified
      0f4d5e65
  2. Apr 07, 2021
    • Karel Koci's avatar
      githooks: fix push reject when develop is directly based on master · 2b87e4ae
      Karel Koci authored
      The issue this fixes is that git reports same commit as being ancestor
      of itself. It kind of makes sense but it breaks check if branch is based
      on master or develop. In such case the common base between develop and
      target branch and master and target branch is the same.
      
      This changes the logic. Because git merge-base does effectively the
      operation of 'less than or equal' we have to swap compare order and
      negate the result. This way we get effectively the 'less than'
      operation.
      Verified
      2b87e4ae
  3. Oct 29, 2020
    • Karel Koci's avatar
      githooks: fix removal of branches · 72cea83e
      Karel Koci authored
      Removal of existing branch wasn't correctly handled. Merged branch
      should be possible to remove but without this hook would complain that
      it can't be removed because it is not based on top of master branch.
      Verified
      72cea83e
    • Karel Koci's avatar
      Add project specific gitconfig and more · 848af2d4
      Karel Koci authored
      This introduces primarily project specific config that includes new
      scripts and hook.
      
      Hook checks if commit we push to Gitlab server are correct. There are
      multiple checks:
      * Check naming convention
      * Check base (master vs develop)
      * Protect against forgotten develop push when pushing master
      
      In terms of aliases this adds:
      git new-mr:
        This opens web browser with new merge request on https://gitlab.nic.cz
        for current branch.
      git new-banch:
        This creates new branch interactively and should help users with
        naming convention.
      Verified
      848af2d4
Loading