Disabling of "Merge commits" on the core ROS 2 repositories

Hi all,

When merging pull requests into the core ROS 2 repositories (those in ros2/ros2.repos at rolling · ros2/ros2 · GitHub), we’ve always used either “Squash and merge” commits or “Rebase and merge” commits. That allows us to keep a linear history, while somewhat obscuring the actual development of the pull request in question. With increasing numbers of maintainers on the core repositories, we are now seeing more PRs merged with “Create a merge commit”.

The point of this post is not to debate the merits of “Squash/Rebase” vs. “Merge” commits in the core. For now, our best practice for core repositories is to use “Squash/Rebase” commits as documented (if you’d like to discuss this practice, we can have a separate discussion).

In order to enforce that, we are considering disabling the “Merge” commit button on the core repositories completely. That means that “Squash and merge” and “Rebase and merge” would be the only option available for merging PRs. If this is going to significantly impact your workflow somehow, please let us know. Otherwise, we’ll be slowly making this change throughout the core repositories.

11 Likes

I would support that, we do that in Nav2 and it makes my life so much easier backporting PRs and looking at the project history keeping a 1:1 of feature development to commits to find bugs / revert issues.

I didn’t know I could disable it, just made in Nav2 such that only squash merging is allowed :smile:

1 Like

Since we’ve had no negative comments, I went ahead and enabled this protection on the core ROS 2 repositories. If you find any deleterious effects, please let us know and we’ll take a look at it.