3 ms·
Git rebase is stupid, I’ve seen countless f ups because someone needed the git history to look good
by m3kw9 3y ago
Git rebase is stupid, I’ve seen countless f ups because someone needed the git history to look good
- jzm2k 3y agogit-rebase is stupid because somebody doesn't know how to use it? I use it all the time and I really like how I can make garbage commits (wip, test) and then squash them into atomic commits which are easy to review and later on easy to bisect when inevitably mistakes happen. Sure I've fucked up too when I was learning on how to use it and those were some painful mistakes but only through using it and making those mistakes have I learned to use the tool to great advantage (clean history).
- gorjusborg 3y agoThe trouble with git rebase is that it can create havoc by those who don't understand what it is doing conceptually, and (probably more importantly) how to recover when things go wrong. When I hear people griping about rebase, I assume that nobody took the time to teach them how to use reflog first. Once I had an understanding of reflog, I could mess up all I wanted (without pushing) and recover. In that environment, rebase can become a very useful tool. Without being able to recover, rebase becomes a tool of confusing irreversible destruction.
- naasking 3y ago> git-rebase is stupid because somebody doesn't know how to use it? The whole purpose of source control is to reliably track code changes so you don't lose anything and can revert to any point or recover from bad merges. Since rebase permits you to violate this core purpose and literally lose the entire history of code changes, then yes, it is stupid.
- bigstrat2003 3y ago> git-rebase is stupid because somebody doesn't know how to use it? No, it's stupid because it's really common for people to fuck it up, and because the purported benefits (clean history) are not something which matters.
- PaulDavisThe1st 3y agoIf I tell you it matters to me, will that change your mind? You've told me that it doesn't matter to you, but that hasn't changed my mind. It's not a matter of objective truth, it's a preference.
- mixmastamyk 3y agoMost of us are paid for working software, not the story of its creation. One is definitely more important than than the other.
- phendrenad2 3y agoPerhaps the danger is the appeal. Pulling off a successful rebase that passes all of the unit tests first try, that's a thrill.
- gosub100 3y agomy case for good-looking history is pride of ownership. Are you proud of this "thing that makes money and ultimately pays your paycheck" or do you leave it polluted and full of crumbs and detritus? I would have made this part of a root-level comment but I doubt anyone would read it, but: I think what gets lost in all these git debates is what language/context are we talking about? a shop that churns out javascript and releases to prod every 8 hours is very different than a C++ shop that writes safety-critical software. Their git needs are very different, and having an "I make my bed every day at 5:30am before I go for a 5mi run and come back and drink my juice and eat avocado toast" git regimen may be appropriate for some codebases but not for others where "I woke up hungover at 10am with a partner whose name I cannot remember, in a bed that is not mine" regimen. I think countless human-brain cycles are lost to bickering between these 2 camps.