to squash or not???

2 views
Skip to first unread message

Jim Hargrave

unread,
Jun 26, 2025, 2:43:12 PMJun 26
to Group: okapi-devel

Denis wans to preserve commits in main not just the PR branch. Personally I prefer squash as it makes the main history much cleaner.

If we use regular merge the git history looks like spaghetti. Maybe there is a middle ground if we make sure to use rebase?

Opinions?

Key Takeaway

If you want a clean main branch but still need to review or audit the full PR commit history, squash merge is the standard approach: the main branch stays clean, and the PR's full commit history remains available in the GitHub UI and via the PR branch as long as it's retained

 If you need the individual commits to be preserved in the main branch itself, do not use squash merge—use the regular merge option instead.


yves.s...@gmail.com

unread,
Jun 26, 2025, 4:40:48 PMJun 26
to okapi...@googlegroups.com

We do use rebase often: it’s nice when there is just one person working on that branch.

But it gets messy if you want to look at it periodically.

-ys

--
You received this message because you are subscribed to the Google Groups "okapi-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to okapi-devel...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/okapi-devel/3e5d9ed5-331d-4d9f-a391-a5b690e9c28e%40gmail.com.

Chase Tingley

unread,
Jun 26, 2025, 4:51:29 PMJun 26
to okapi...@googlegroups.com
I prefer squashing, personally, because I often have 4 commits just called "cleanup" at the end of every PR.  Denis keeps his branch history extremely clean -- he rebases and squashes internally quite a bit -- so usually he is only committing a single commit + merge commit.

Is there middle ground here?  If we don't squash anything, we are asking every developer to do more git history cleanup on their own branches that they may not be used to doing.

Jim Hargrave

unread,
Jun 27, 2025, 11:47:13 AMJun 27
to okapi...@googlegroups.com, Chase Tingley

I will re-enable the option to do normal merge in gitlab - then let Denis choose. I think the middle ground to keep things clean (other than squash) is to:

  1. Always fetch/merge (never pull)
  2. Rebase by default.

I've found that #1 prevents the automated commit I got when I only pulled (which then needed to be pushed)

Jim

Reply all
Reply to author
Forward
0 new messages