Multi-commit PRs vs. multiple single-commit PRs

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 22 21:28:28 PDT 2017


On Thursday, March 23, 2017 02:57:04 Vladimir Panteleev via Digitalmars-d 
wrote:
> On Wednesday, 22 March 2017 at 17:16:09 UTC, Andrei Alexandrescu
>
> wrote:
> > I'm a bit confused. This got settled a while ago, in part to
> > avoid silly debates over the inconsequential. Our organization
> > prefers squash before commit in the majority of cases. For a
> > minority of pull requests (that touch many files, are
> > semi-mechanical etc) multiple commits in one PR are fine within
> > reason. These would be about one order of magnitude less
> > frequent. -- Andrei
>
> Well, I don't think we shouldn't keep researching for ways to
> improve wolkflow. I certainly don't think it's inconsequential,
> and anyone who has time and thinks they can bring fresh arguments
> to the table is welcome to do so.
>
> There are some very solid arguments in favor of moving to an
> exclusively one-commit-per-PR model, with no exceptions (with
> more involved contributions occurring in feature branches), the
> main obstacle for which is that the tooling isn't there. I also
> think we can do better for the current model - the diff tab is
> often misused when reviewing per-commit is more appropriate.

Honestly, I think that having only one commit per PR would encourage overly
large commits. Being able to have a series of small commits merged together
is a strength of git, whereas something like svn usually results in patches
that are single, larger commits. I also don't like the idea that commits get
squashed when merged. In theory, they were separate for a reason, and in the
cases that squashing them all makes sense, the commits were probably too
small to begin with. But there is a bit of an art to creating commits that
are small enough to be sensible while not having too many of them, and I've
definitely seen PRs for Phobos that had way too many small commits, because
the person who created the PR didn't bother to squash stuff where it made
sense.

- Jonathan M Davis



More information about the Digitalmars-d mailing list