| Yep, IMO this is always the best of the 3 strategies. The PR is the unit of work, people get too hung up on the PR's individual commits. Worst: rebase and merge - you end up with your coworker's broken WIP commits all over master, and have a terrible git revert story OK: merge commit - you can revert, but there is a less intuitive `-m 1` flag (IIRC?) you have to pass into revert, and IMO you rarely need the intermediate history. Best: squash & merge - you get one single commit representing the unit of work merging in, git revert is dead easy Also setting the commit message in main to the `{title} (#{prNum})\n\n{prDescription}` format preserves all the good context from your PR and lets you get back to it if you need. |
1. You get rid of WIP commits, typo fix commits, all kinds of transient changes (for review and so on)
2. You keep the substantive ones
3. All changes are logically separated
I don’t see where you cover this option.
> Also setting the commit message in main to the `{title} (#{prNum})\n\n{prDescription}` format preserves all the good context from your PR and lets you get back to it if you need.
Again. It is ironic that people are so comfortable with dumping the history in a webapp when you are working with a version control system.
I am fine with a lot of the history being on GitHub or whatever other webapp. The review history, that is. But I’m not comfortable with leaving the history of the pre-squashed commits on GitHub if those pre-squashed commits were useful for the long-term history.