{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/8665","repository_url":"https://api.github.com/repos/systemd/systemd","labels_url":"https://api.github.com/repos/systemd/systemd/issues/8665/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/8665/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/8665/events","html_url":"https://github.com/systemd/systemd/issues/8665","id":311625312,"number":8665,"title":"Suggestion: Enable \"Rebase + Merge\" in GitHub","user":{"login":"filbranden","id":106037,"avatar_url":"https://avatars0.githubusercontent.com/u/106037?v=4","gravatar_id":"","url":"https://api.github.com/users/filbranden","html_url":"https://github.com/filbranden","followers_url":"https://api.github.com/users/filbranden/followers","following_url":"https://api.github.com/users/filbranden/following{/other_user}","gists_url":"https://api.github.com/users/filbranden/gists{/gist_id}","starred_url":"https://api.github.com/users/filbranden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filbranden/subscriptions","organizations_url":"https://api.github.com/users/filbranden/orgs","repos_url":"https://api.github.com/users/filbranden/repos","events_url":"https://api.github.com/users/filbranden/events{/privacy}","received_events_url":"https://api.github.com/users/filbranden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-04-05T14:06:49Z","updated_at":"2018-05-10T06:18:16Z","closed_at":null,"author_association":"MEMBER","body":"It's a slight variation on the \"Squash + Merge\" feature, but it's more useful for when there are multiple commits in a single PR...\r\n\r\nHere are instructions on how to enable it:\r\nhttps://help.github.com/articles/configuring-commit-rebasing-for-pull-requests/\r\n\r\nNeeds to be done by an owner of the project."},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/387963202","html_url":"https://github.com/systemd/systemd/issues/8665#issuecomment-387963202","issue_url":"https://api.github.com/repos/systemd/systemd/issues/8665","id":387963202,"user":{"login":"filbranden","id":106037,"avatar_url":"https://avatars0.githubusercontent.com/u/106037?v=4","gravatar_id":"","url":"https://api.github.com/users/filbranden","html_url":"https://github.com/filbranden","followers_url":"https://api.github.com/users/filbranden/followers","following_url":"https://api.github.com/users/filbranden/following{/other_user}","gists_url":"https://api.github.com/users/filbranden/gists{/gist_id}","starred_url":"https://api.github.com/users/filbranden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filbranden/subscriptions","organizations_url":"https://api.github.com/users/filbranden/orgs","repos_url":"https://api.github.com/users/filbranden/repos","events_url":"https://api.github.com/users/filbranden/events{/privacy}","received_events_url":"https://api.github.com/users/filbranden/received_events","type":"User","site_admin":false},"created_at":"2018-05-10T06:18:16Z","updated_at":"2018-05-10T06:18:16Z","author_association":"MEMBER","body":"So we had another example where squash clobbered the author of a commit and rebase would have been helpful.\r\n\r\nMore specifically, PR #8874 which @evverx authored and sent to the mailing list, but I sent the PR (since he was having trouble with his GitHub access), was then merged into a605e46f2990a016857618e47afe495af1a2a469 which looks authored by me.\r\n\r\nSo I went on and did some tests between Merge/Squash/Rebase to see how they worked. I ended up doing all tests with a PR with a single commit (the one from #8874, just rebased it on top of 30 commits before it) and then I merged/squashed/rebased it on top of a605e46f2990a016857618e47afe495af1a2a469~ in different branches.\r\n\r\nResults are here:\r\n- Merge:\r\n   https://github.com/filbranden/systemd/commits/test8665_filbranden_merge\r\n   (PR filbranden/systemd#1)\r\n- Squash:\r\n   https://github.com/filbranden/systemd/commits/test8665_filbranden_squash\r\n   (PR filbranden/systemd#2)\r\n- Rebase:\r\n   https://github.com/filbranden/systemd/commits/test8665_filbranden_rebase\r\n   (PR filbranden/systemd#3)\r\n\r\nI guess we don't need to discuss \"Merge\", since it's the default and everyone kind of knows how it works...\r\n\r\nSquash clobbered the author, as we expected. The commit description was updated to include the PR number `(#2)` at the end of the first line.\r\n\r\nThe \"Rebase\" one looks very similar to the \"Squash\" one, except that the commit description is pristine (the PR number was not added) and the author information was not touched (the commit date was not touched either.)\r\n\r\nOne concern that was raised was mapping commits back to PRs. That information is actually **not lost**. Looking at that commit (at https://github.com/filbranden/systemd/commit/16a5f1ef7964c026e981c8d0624a079fb03a8d4d), below the commit description, there's a small section that shows `test8665_filbranden_rebase (#3)`, which is the destination branch and the PR number. the `(#3)` links back to filbranden/systemd#3 which is the PR that merged (/rebased) it.\r\n\r\nSo, frankly, my impression is that \"Rebase\" is superior to \"Squash\" in about every way. Probably the only case where we would want to use \"Squash\" is when the PR author is sending incremental fixes and we'd really want to squash it all at merge time. (Though usually I'd prefer asking the author to do so.)\r\n\r\n(An aside, but I'd actually prefer using \"Rebase\" instead of \"Merge\", I think there are benefits in having a linear history and not having tons of merge commits around... As pointed out, we can always trace the commits back to the PRs for access to the discussion, etc.!)\r\n\r\nI also prepared some extra test PRs, in case you would like to test this for yourselves. You might need to accept my [invitation to collaborate](https://github.com/filbranden/systemd/invitations) to my forked repository, then you can look at PRs filbranden/systemd#4 (Merge), filbranden/systemd#5 (Squash) and filbranden/systemd#6 (Rebase) and do the operations for yourselves, then look at the branches and commits, trace the rebased commits back to the PR that merged them, etc.\r\n\r\nLet me know if you have any questions. I'm happy to do further experiments, though I really think we should just go ahead and enable this, start using it and disable back if for some reason we're not satisfied...\r\n\r\nCheers!\r\nFilipe\r\n"}}
{"actor":{"display_login":"filbranden"}}