• We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      As a repository admin, I want to ensure that a branch is not only fast-forward only but also does not contain merges, which enforces committers to this branch to rebase their work properly.

      This helps to keep the commit history sane and reliable to work with using external automation tools. Otherwise, the possibility exists that existing changes are missed out by i.e. reporting tools that evaluate changes between two commits.

      Additional acceptance criteria:

      • The branch name(s) to which this applies can be specified using standard regular expressions


      This request shall enable the same functionality that is available in gitolite:

          Form Name

            [BSERV-4211] Allow no-merges policy

            Hi Ancoron,

            Unfortunately we cannot commit to a change that restricts workflow in such a way at this time.

            We are considering support for rebase workflows in the linked issue STASH-2874. However we are not planning to introduce general enforcement to prevent merge commits as this is not in the spirit of git's design.

            Nonetheless, this is something that would still be possible by way of a plugin, perhaps the one I mentioned previously could be adapted. On another note, I'd suggest looking at ways to make sure 3rd party or custom tools try to work with commit trees as provided by git rather than trying to avoid situation where a non-linear history occurs.

            Roger Barnes (Inactive) added a comment - Hi Ancoron, Unfortunately we cannot commit to a change that restricts workflow in such a way at this time. We are considering support for rebase workflows in the linked issue STASH-2874 . However we are not planning to introduce general enforcement to prevent merge commits as this is not in the spirit of git's design. Nonetheless, this is something that would still be possible by way of a plugin, perhaps the one I mentioned previously could be adapted. On another note, I'd suggest looking at ways to make sure 3rd party or custom tools try to work with commit trees as provided by git rather than trying to avoid situation where a non-linear history occurs.

            Looks good at first glance but the code actually only applies to merge commits from the same branch, which means that merge commits in general are still possible (e.g. merging from different branches).

            So no, that does not suit my needs.

            Deleted Account (Inactive) added a comment - - edited Looks good at first glance but the code actually only applies to merge commits from the same branch, which means that merge commits in general are still possible (e.g. merging from different branches). So no, that does not suit my needs.

            Roger Barnes (Inactive) added a comment - I just noticed this plugin which might suit... https://marketplace.atlassian.com/plugins/com.carolynvs.reject-merge-commit-hook

              Unassigned Unassigned
              b54b3051-02a3-482c-adb4-1125ccb7a257 Deleted Account (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: