Thread overview
Git "squash and merge"
Jan 18
kinke
January 17
Hi all,
  Do you like the "Squash and merge" thing of Github (no merge bubble, instead a rebase+fastforward merge)? We've used it a few times now, should it be the default or do you like normal merge better? Or perhaps you really just don't care :-)

I am undecided on it, and think it doesn't matter much. So generally, when there is no squashing to be done, I do a merge like before. Otherwise a squash+merge.

-Johan

January 18
I've seen you using it, and I liked it especially for cherry-picking onto a release branch, as the automatic reference to the PR (`... (#<number>)` in commit title) makes it show up in the PR directly.

On Tuesday, 17 January 2017 at 21:44:53 UTC, Johan Engelen wrote:
> So generally, when there is no squashing to be done, I do a merge like before. Otherwise a squash+merge.

Similar here, but I like it especially for single-commit PRs, as having two commits for each of those doesn't make a lot of sense to me.
January 18
On Wednesday, 18 January 2017 at 09:55:58 UTC, kinke wrote:
> I've seen you using it, and I liked it especially for cherry-picking onto a release branch, as the automatic reference to the PR (`... (#<number>)` in commit title) makes it show up in the PR directly.

That's a very good argument.

> On Tuesday, 17 January 2017 at 21:44:53 UTC, Johan Engelen wrote:
>> So generally, when there is no squashing to be done, I do a merge like before. Otherwise a squash+merge.
>
> Similar here, but I like it especially for single-commit PRs, as having two commits for each of those doesn't make a lot of sense to me.

OK, so I'm going to try to do this from now:

if (commitCount < 2) {
    squashAndMerge();
} else {
    if (niceToPreserveIndividualCommits()) {
        while (tooManyFixupCommits()) {
             askForManualCommitHistoryCleanup();
             yield();
        }
        merge();
    } else {
         squashAndMerge();
     }
}