• 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.

      The pull requests are a nice feature, but not only do we still need to delete branches manually (see issue STASH-2753), it is also not possible to squash the new commit into the target branch.
      We would like to have a clean history that doesn't show any parellel commits in our main development and master branches.

      It seems that this is relatively easy to implement, since it is a new button and a few extra git commandline calls. But that is from a user point of view.

            [BSERV-2810] Option to squash commits when merging a pull request

            I know this ticket is closed now (thanks to the "squash merge" ability of Bitbucket 4.9), but I thought people might be interested in a way to squash the source branch without actually touching the target branch.  The paid Bit-Booster add-on puts a Squash button on the pull-request screen and let's you do exactly that. The result is pushed to the source branch via "git push --force-with-lease", and it respects all branch permissions and push hooks.

            It also let's you edit the commit message of the final commit, and if the squashed commits involved more than one author, it let's you select the author (defaults to author of oldest commit).

            Here's a screenshot of the Squash button:

             

            Julius Davies [bit-booster.com] added a comment - - edited I know this ticket is closed now (thanks to the "squash merge" ability of Bitbucket 4.9), but I thought people might be interested in a way to squash the source branch without actually touching the target branch.  The paid Bit-Booster add-on puts a Squash button on the pull-request screen and let's you do exactly that. The result is pushed to the source branch via "git push --force-with-lease", and it respects all branch permissions and push hooks. It also let's you edit the commit message of the final commit, and if the squashed commits involved more than one author, it let's you select the author (defaults to author of oldest commit). Here's a screenshot of the Squash button:  

            Matt,

            I think what you're looking for is BSERV-2894. I'd encourage you to vote for and watch that issue.

            Best regards,
            Bryan Turner
            Atlassian Bitbucket

            Bryan Turner (Inactive) added a comment - Matt, I think what you're looking for is BSERV-2894 . I'd encourage you to vote for and watch that issue. Best regards, Bryan Turner Atlassian Bitbucket

            Matt Quigley added a comment - - edited

            Really happy this feature was added. We wrote our own plugin that did this. There's one deal breaker that's preventing us from switching over to the Bitbucket merge strategy, though.

            The commit messages will all be titled "merged xxx into master". A much better title is the PR title, which would be an appropriate summary like "Updated colors on accounts". The messages as-is renders a repo log so hampered as to be almost unusable.

            In essence, it would be great if there were an option to include the pull request message in the commit.

            If you're curious - here's our javascript which does this for us in our plugin:

            // Set default commit message
            var pullRequest = state.getPullRequest();
            var commitMessage = pullRequest.title + "\n\n" + pullRequest.description + "\n\n" + pullRequest.links.self[0].href;
             AJS.$('#squashmerge-dialog').find('textarea').val(commitMessage);

            Matt Quigley added a comment - - edited Really happy this feature was added. We wrote our own plugin that did this. There's one deal breaker that's preventing us from switching over to the Bitbucket merge strategy, though. The commit messages will all be titled "merged xxx into master". A much better title is the PR title, which would be an appropriate summary like "Updated colors on accounts". The messages as-is renders a repo log so hampered as to be almost unusable. In essence, it would be great if there were an option to include the pull request message in the commit. If you're curious - here's our javascript which does this for us in our plugin: // Set default commit message var pullRequest = state.getPullRequest(); var commitMessage = pullRequest.title + "\n\n" + pullRequest.description + "\n\n" + pullRequest.links.self [0] .href;  AJS.$('#squashmerge-dialog').find('textarea').val(commitMessage);

            Me too, thank you!

            Jerry Thome added a comment - Me too, thank you!

            +1, thanks!

            Alexey Efimov added a comment - +1, thanks!

            Very excited about this feature, great work, folks at Atlassian.

            angelo_iress added a comment - Very excited about this feature, great work, folks at Atlassian.

            Hi all,

            Thank you for your suggestions, votes and feedback. We're happy to announce that the option to squash commits when merging a pull request is available in the UI as part of our improvements in merge strategies in Bitbucket Server 4.9. More details about configuring merge strategies (including squash on merge) can be found in our release notes and documentation, and you can download the latest version of Bitbucket Server from this link.

            Cheers,
            Norman Ma [Atlassian]

            Norman Ma (Inactive) added a comment - Hi all, Thank you for your suggestions, votes and feedback. We're happy to announce that the option to squash commits when merging a pull request is available in the UI as part of our improvements in merge strategies in Bitbucket Server 4.9. More details about configuring merge strategies (including squash on merge) can be found in our release notes and documentation , and you can download the latest version of Bitbucket Server from this link . Cheers, Norman Ma [Atlassian]

            DanielB added a comment -

            Your competition have something similar now:

            https://github.com/blog/2141-squash-your-commits

            DanielB added a comment - Your competition have something similar now: https://github.com/blog/2141-squash-your-commits

            Thanks everyone for the input. As always, we can't talk timelines as plans and priorities can change, but this has been high on our list for a while, and we'll be sure to update here when we know more.

            Roger Barnes (Inactive) added a comment - Thanks everyone for the input. As always, we can't talk timelines as plans and priorities can change, but this has been high on our list for a while, and we'll be sure to update here when we know more.

            sean koji carey added a comment - - edited

            It would be really nice if there was a checkbox on the "merge pull request" dialog that dropped down to a textbox when you clicked it. The textbox could contain your squash commit message. Then it could just add the squash options to the git merge command it runs in the background.

            Yes please!! Exactly that, It would save us so much manual busy-work cleaning up commit messages

            sean koji carey added a comment - - edited It would be really nice if there was a checkbox on the "merge pull request" dialog that dropped down to a textbox when you clicked it. The textbox could contain your squash commit message. Then it could just add the squash options to the git merge command it runs in the background. Yes please!! Exactly that, It would save us so much manual busy-work cleaning up commit messages

              crolf Christian
              1d453086d3a1 Paul B. Omta
              Votes:
              307 Vote for this issue
              Watchers:
              170 Start watching this issue

                Created:
                Updated:
                Resolved: