This is an archive of the discontinued LLVM Phabricator instance.

docs/GitHub: Add note about force-pushing when rebasing on main
AcceptedPublic

Authored by tstellar on May 15 2023, 10:19 AM.

Diff Detail

Event Timeline

tstellar created this revision.May 15 2023, 10:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2023, 10:19 AM
tstellar requested review of this revision.May 15 2023, 10:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2023, 10:19 AM
mehdi_amini added inline comments.May 15 2023, 10:38 AM
llvm/docs/GitHub.rst
40

Is this an opportunity to squash? Does GitHub preserve better the history if we force-push on rebase but don't squash?

The issue with this way of adding "fix up" commits is that a conflict during rebase may lead to as many redundant manual conflict resolution as there are "fix up" commits.

nridge added a subscriber: nridge.May 15 2023, 11:07 PM
jhenderson added inline comments.May 17 2023, 12:34 AM
llvm/docs/GitHub.rst
40

Force pushes being unavoidable when doing rebases is one of the reasons I have a dislike of reviewing on GitHub, due to the issues it has.

Regarding the additional sentence itself, I'm fine with it. I don't know of a way that will improve comment history more than anything else (squashing probably is safe, and I have no objection to encouraging it as per @mehdi_amini's comment). That being said, I haven't done any rigorous testing.

mehdi_amini added inline comments.May 17 2023, 8:27 PM
llvm/docs/GitHub.rst
40

Technically one would want to squash first, and rebase after! (to avoid the multiple conflicts resolution)

There is also the option of merging main back into the user branch instead of force-pushing: why not this?

jhenderson added inline comments.May 18 2023, 12:55 AM
llvm/docs/GitHub.rst
40

There is also the option of merging main back into the user branch instead of force-pushing: why not this?

Doesn't that require a merge commit? I'm pretty sure we don't want those in our main branch history, and I don't know how that then plays with the squash & merge button at the end.

mehdi_amini added inline comments.May 18 2023, 1:04 AM
llvm/docs/GitHub.rst
40

With squash&merge and our branch protection, we can guarantee that main will end up with a single fast-forward commit, so it shouldn't matter there.

Ping on this? Merge main into the development branch or rebase?

ldionne accepted this revision.Aug 31 2023, 8:03 AM

IMO the new sentence makes sense and we should just ship this.

This revision is now accepted and ready to land.Aug 31 2023, 8:03 AM

Gentle ping on this. Let's either abandon this or merge it to clear up the review queue.