Heyah,
I'd like to open the debate on the item no 5 of the Contributors Guide of discourse:
5. Commit
First, ensure that if you have several commits, they are squashed into a single commit:
My question is pretty simple: Why?
pro
From all I got, squashing into a single commit (and rebasing in general) serves mainly two goals: In a review-system, where you send patches via email a single commit is easier to review than a bunch of them. Secondly, it is about keeping a clean git history of single branch with one-parent-only-commits, making it easier to get back in time and follow what was going on when (supposedly).
is that so?
Both of these arguments kinda don't seem to apply here, as we are using the Github Pull-Request system, which a) gives a very pretty view page for reviewing with one-single-resulting diff to review and comment and b) creates a merge-commit anyways instead of fast-forwarding a rebased commit ergo messing with the history in the same ugly way (as the graph shows). Our history is already messy and will stay messy, squashed single-commits won't change that. So, I don't get why there should be one squashed commit in the Pull-Request only. Am I missing some good reason here?
contra
On the other hand, messing with the history has a bunch of disadvantages. I'd like to point out the following two impacting us:
For once, the history shows the development but also the review process:
Thinking of the review of a big patch and few lines need to be changed after the first iteration of reviews. So to check up on those issues is very easy in a normal history, where you just look at those changesets commited since the comment (in the pretty github pull-request timeline it is even more convenient). Instead with a newly squashed commit, you can't follow that change anymore easily, as the whole changeset is "new". Reviewing becomes a pain as you'd need to review the entire patch every time again. Reviewing big patches becomes just impossible.
(Aside from the person doing the changes having to push --force
every time they did what they've been asked to do - which feels clearly wrong.)
But more over, it makes it impossible to base future work on work in review:
I have a pull-request for a stand-alone feature on github right now. Following this feature I have two others that depend on this one, I could easily start to develop now already, while this one is in review. But as squashing and rebasing commits creates new commits in the history, I can't base my work on top of this branch right now. The second the review requires, the commit I branched from will be gone and I will have a conflict later when getting this merged. Which is clearly not a problem, if there was a history of changes to rely on. Especially pull-request that might spark some longer discussing (like this one is), this is stalling time on future features, too. I'd rather work on the future features, also giving this pull-request more context and insight what is meant for instead.
So, maybe I am missing some great reason to use squashed commits for our pull-requests here, but I don't see how these drawbacks are a good trade-off. Please enlighten me.