Skip to content

Add merge_request.squash git push option

What does this MR do and why?

This MR adds support for configuring a MR to squash commits, with a new merge_request.squash git push option.

Changelog: added

Closes #471590

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

With squash and without create With squash+create Resulting MR
image image image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Clone a project from the GDK to your local computer

  2. Create a new branch

  3. Make a change in that branch and commit it

  4. Push the change with the new option:

    git push --set-upstream origin -o merge_request.create -o merge_request.squash
  5. Open the resulting MR and confirm that the Squash commits when merge request is accepted merge option is enabled.

    image

  6. You can try the same without specifying merge_request.squash to verify that the option is not applied in that case.

    image

Merge request reports