News for hackers. Stuff that matters.
Re:Commits are snapshots not diffs (2020) by breischl on Thursday April 08, 2021 @03:48PM (#26742942)
When I've done this, your private/dev branch may be a series of broken commits. Then you rebase onto main, squash to one commit, and test (if necessary). So what shows up on the main branch is a single, squashed, tested commit that contains one logical unit of code (usually a feature or fix).

In this model the main branch history is "real" in that it records the sequence of changes to the production code. It's "fake" in that it doesn't record the exact sequence of fumbling steps and backtracks you took to get there. But IME the latter is usually not very useful anyway.

Re:Commits are snapshots not diffs (2020) by fshbbdssbbgdd on Thursday April 08, 2021 @03:54PM (#26743004)
I like the squashed commit approach. I get there by merging upstream into my dev branch when developing, then squashing before I merge my changes into the upstream. As far as I can tell, that has the same outcome as rebase with squash. Both approaches create a simple commit graph, and both avoid fake intermediate commits.
Re:Commits are snapshots not diffs (2020) by xoudini on Thursday April 08, 2021 @04:04PM (#26743114)
In some cases I agree, but squashes can end up so large that doing a `git bisect` (which is quite useful in finding the comparatively small commit which introduced a bug) becomes unfeasible.