(no title)
aidos | 8 days ago
In 25 years of professional development I’ve never really had a situation where the commits on a branch would have helped me understand what was going on a year ago when the work was done. That includes pretty big bits of project work.
I’d much rather have a trunk with commits at the granularity of features.
rsaarsoo|8 days ago
What has happened a whole lot though is the exact opposite.
Normal_gaussian|8 days ago
As such, a new codebase is likely to grow by large unwieldy commits and a mature one by targetted small commits.
aidos|7 days ago
The other thing to say - that is missing from this conversation - is that if you’re using github, the original commits are still against the PR.
StrangeSound|8 days ago
sodapopcan|8 days ago
I've had separate commits come in handy several times when `git blame`ing when working with people who actually described what changes were about in their commits (which, unlike comments, don't go out of date).
lloeki|8 days ago
Coincidentally, every single squash-merge commit advocate I've had the unfortunate debate with was a regular practitioner of public tmp / tmp / try again / linter / tmp / fix / fix / haaaaaands commits.
Note that I'm not against squashing/history rewriting e.g rebase -i and stuff (which I'm a heavy user of so as to present sensible code aggregation reviewable per-commits), only squash-merge.
homebrewer|8 days ago
I chunk my changes into tiny commits ("linter"/"tmp"/"wip"), but then rebase aggressively, turning it into a set of logical changes with well-formed commit messages. git bisect/revert work great with history written in this way even years layer.
But: most of the people I've been interacting with also produce lots of "wip"/"tmp", but then skip the rebase. I can only offer my help with learning git rebase for so long before it starts taking too much time from the actual work. So squash it is: at least it produces coherent history without adding thousands of commits into `--ignore-revs-file`.
skydhash|8 days ago
A ticket should be atomic describing a single change request. PR in this case are the working room. It can be as messy or as clean as you want. But the goal is to produce a patch that introduces one change. Because if you would rebase -i at the end, you would have a single commit too in the PR.
groestl|8 days ago
ahartmetz|8 days ago
locknitpicker|8 days ago
My professional experience contrasts with yours. I've even worked at a company where commit history and PRs were so central to understand and explain changes that PRs were even used as the authoritative sources on how to implement features and use frameworks.
aidos|8 days ago
Maybe different in other places, but after 15 years in my codebase, I’m still happy with a simple linear history.
barrkel|8 days ago
It's less about reviewing commits from a year ago, than making change low-risk today. And small commits can easily be rolled back. The bigger the commit, the more likely rollback will be entangled.
It better to have partial features committed and in production and gated behind a feature flag, than risk living in some long-lived branch.
locknitpicker|8 days ago
You're not addressing the problem. You're just wishing that the problem wouldn't happen as frequently as it does.
But that's like wishing that race conditions don't happen by making your allocations at a higher frequency.
VorpalWay|8 days ago
I strive to do that when making commits for work too, and that helps when going back in history and looking at history to motivate why a change was made.
While working I rebase all the time to move changes into the relevant commit, I don't find that particularly hard or time consuming. Doing this upfront is easy, splitting commits after the fact is not.
I consider this standard practice, at least in the sector I work in (industrial equipment control software, some of which is considered human safety critical).