News for hackers. Stuff that matters.
Re:Firefox Moves to GitHub by spookie on Tuesday May 13, 2025 @02:49AM (#43970187)
To be fair, most of the its difficulty is realized when you're stuck with a teammate rewriting history. Who, much like anyone anyone doing the same, hasn't bothered reading a book explaining things.
Re:Firefox Moves to GitHub by jamienicol on Tuesday May 13, 2025 @03:18AM (#43970388)
That problem is solved by preventing forced pushes. Rewriting history locally is encouraged.
Re:Firefox Moves to GitHub by Tainnor on Tuesday May 13, 2025 @04:44AM (#43970859)
Prevent forced pushes on protected branches (develop, main, hotfix etc.). I don't care if somebody force pushes their private feature branch.
Re:Firefox Moves to GitHub by cmrdporcupine on Tuesday May 13, 2025 @07:16AM (#43971661)
Force pushing onto PR branches is the only way to make the commit history in them sane.

But GH's PR process is broken anyways. I miss Gerritt.

Re:Firefox Moves to GitHub by baq on Tuesday May 13, 2025 @03:02AM (#43970280)
If you don't rewrite history in git, I don't want to bisect in your repos.

If you push rewritten history to master, you're a git.

Conclusion: learn your tools.

Re:Firefox Moves to GitHub by mkesper on Tuesday May 13, 2025 @03:23AM (#43970414)
The modern workflow is just to let GitHub squeeze yor shit commits into one and then rebasing that.
Re:Firefox Moves to GitHub by baq on Tuesday May 13, 2025 @04:05AM (#43970622)
Hardly anything modern about it, but it's a way of keeping a somewhat sane history. Certainly better than merging 'fix' 'fix' 'fix comments' into master.

The thing, we could have done better (and have been) since before git even existed.

Re:Firefox Moves to GitHub by cmrdporcupine on Tuesday May 13, 2025 @07:18AM (#43971671)
There are legit reasons to have a series of commits within one PR, and rebase and merge them as is, and use amend/fixup and force pushes to maintain them cleanly.

It's not my favourite process, but...

Re:Firefox Moves to GitHub by vvillena on Tuesday May 13, 2025 @02:25PM (#43976065)
The "squash everything" mantra turns git commit history into a series of snapshots devoid of any logical notion about how code evolves.

Squashed commits are strictly worse than plain, non-fast-forwarded merges from rebased branches.

Re:Firefox Moves to GitHub by baq on Tuesday May 13, 2025 @02:50PM (#43976294)
Depends on your commits. If it’s untested noise I’d much rather they’re squashed so bisect doesn’t meander in trash.
Re:Firefox Moves to GitHub by vvillena on Tuesday May 13, 2025 @03:12PM (#43976506)
Bisecting with --first-parent takes care of this.
Re:Firefox Moves to GitHub by spookie on Wednesday May 14, 2025 @03:16PM (#43988211)
Not a single soul besides the one rewriting history knows what they're in for after the fact.

It's a recipe for disaster.

Unless you mean squashing commits, which I don't consider rewriting history, just a retelling of the fact. Still, it's something one can only do very sporadically, or at known periods of time. I

'm sure others would be more pedantic about it and this wasn't clear above.

Re:Firefox Moves to GitHub by tester756 on Tuesday May 13, 2025 @03:11AM (#43970348)
No, git's CLI is terrible mess.