44 ms·
One of the teams I work on is pretty religious about one commit per PR and mandatory rebasing, which is a nuisance at times, particularly when one feature is ma
by Macha 10y ago
One of the teams I work on is pretty religious about one commit per PR and mandatory rebasing, which is a nuisance at times, particularly when one feature is made up of multiple different steps
e.g. refactor code to allow thing X to be pluggable, implement new alternative for thing X, load thing X if user has the right permissions all need to be squashed down to just "implement thing X"
- jacques_chester 10y agoI think I would dislike that style as well. My goals in committing and editing history are, in order: 1. Is master always safe and deployable? 2. Does the history tell the logical story? 3. Does the history tell the physical story? That is, I prefer safety/deployability above all other considerations. Then I prefer a history that makes sense and can be comprehended. Then and only then do I care about the actual order and content of commits. Rebasing down to a single commit satisfies 1, but ignores 2 and 3. In my experience 1 and 2 go together very well.
- Androider 10y agoThat kind of dogma does seem a bit silly, but why wouldn't you split the commits into separate pull requests instead of squasing, e.g. PR1: "refactor code to allow thing X to be pluggable", PR2: "implement new alternative for thing X" etc. The discussion around PR1 can then focus on just the plugin interface for example.
- Macha 10y agoEach PR needs its own branch build and then a CI build after merging. So there'd be lots of downtime just screwing around with CI builds and resolving interim merge conflicts.
- jononor 10y agoOne commit per PR? Is that an attempt at making PRs be small and focused? Does it work?
- Macha 10y agoNo. It's an overreaction to how messy our commits were before. Some team members hate seeing merge commits, and our Stash system did a --no-ff merge previously. Plus there's a lot of contributors so people often had to merge master into their branch to resolve merge conflicts so they could merge, as there's sometimes 10 or more merges to master a day. So one branch might have 2-3 commits of work, and 2 merges from master. So our commit history might look like: * Merge foo into master * Merge master into foo * Update foo per PR comments * Merge master into foo * Second meaningful commit on foo * First meaningful commit on foo This is not a long running branch, it could have been one that was started and had a PR opened at 11am and was reviewed and merged at 4pm. So they instead configured our Stash instance to do an autosquash and if your PR didn't squash required it done manually. Now it looks like * Merge foo into master * Merge bar into master * Meaningful message about foobar from someone that does a manual rebase to avoid the autosquash * Merge quu into master I'm think the new situation is even worse, but I'm outvoted there.