Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,093
    • Issues 44,093
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,305
    • Merge requests 1,305
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #212
Closed
Open
Created Jan 20, 2016 by Boris Dušek@dusek

Honor "fixup!" commits in merge requests

When an admin selects "Fast-forward merge" Merge method in Project Settings, a "Rebase merge request" button is present in merge requests where the master (or the branch to which a merge is requested) has changed since submitting the merge request.

When one then pushes further commits to the merge request's source branch which address review comments in a way of doing git commit --fixup <sha> (e.g. not to mess up previous inline comments made in the diff by a reviewer, and/or to be clear about what is being changed), and then the reviewer chooses to use the "Rebase merge request" button, I would expect the "fixup! ..." commits to be squashed into the commits they are fixing, just like if git rebase --autosquash --interactive master was run with accepting the proposed TODO list for the rebase. But that is not the case (I just tried on a demo project) - the commits in the source branch are rebased on the latest master, but with the "fixup!" commits treated as completely ordinary commits (i.e. still present).

Proposal

If a merge request contains a fixup! commit that targets a commit in the feature branch, the merge request interface should handle this according to the merge method in the project settings:

  • Merge commit
    • If Squash and Merge is enabled, the fixup commit doesn't matter because it'll be squashed away
    • Else, show a message and a rebase button
  • Merge commit with semi-linear history - Rebase merge request button should rebase with --autosquash support
  • Fast forward merge – Rebase merge request button should rebase with --autosquash support

Links / references

  • https://robots.thoughtbot.com/autosquashing-git-commits
Edited Dec 13, 2019 by James Ramsay (ex-GitLab)
Assignee
Assign to
Time tracking