Zulip Chat Archive

Stream: general

Topic: squashing PRs


Yury G. Kudryashov (Oct 23 2019 at 22:29):

Hi, what is the reason for squashing PRs? What's wrong with just merging branches? Then git log --merges will show what git log shows now.

Reid Barton (Oct 23 2019 at 22:33):

Many commits would not build then. Would git bisect handle this properly? Or Travis?
More generally, I find git repositories with merges kind of difficult to deal with, maybe because I'm not used to them...

Yury G. Kudryashov (Oct 23 2019 at 22:38):

Does Travis care about commits other than HEADs of the master and PRs?

Yury G. Kudryashov (Oct 23 2019 at 22:38):

Didn't try git bisect yet.

Reid Barton (Oct 23 2019 at 22:38):

For example, although I'm not sure this exact situation would arise in practice, I don't think git rebase works properly when you try to rebase a merge commit. At least it did not work ~10 years ago.

Yury G. Kudryashov (Oct 23 2019 at 22:39):

You shouldn't rebase master anyway.

Reid Barton (Oct 23 2019 at 22:40):

What would git log -p --merges show?

Reid Barton (Oct 23 2019 at 22:41):

oh, maybe git log --first-parent is better?

Reid Barton (Oct 23 2019 at 22:42):

Maybe a better answer is that currently most contributors don't attempt to create anything like a clean history on their PR branches, so the extra information that would be retained by merging is sort of garbage.

Yury G. Kudryashov (Oct 23 2019 at 22:43):

Yes, this is a good reason.

Reid Barton (Oct 23 2019 at 22:45):

Another side effect of this is the terrible commit messages

* oops
* fix
* fix again

Last updated: Dec 20 2023 at 11:08 UTC