Most active commenters
  • baq(3)

←back to thread

848 points thefilmore | 13 comments | | HN request time: 1.069s | source | bottom
Show context
bandrami ◴[] No.43969975[source]
Pretty cool that Linus Torvalds invented a completely distributed version control system and 20 years later we all use it to store our code in a single place.
replies(29): >>43969999 #>>43970002 #>>43970008 #>>43970018 #>>43970019 #>>43970028 #>>43970031 #>>43970032 #>>43970036 #>>43970037 #>>43970142 #>>43970154 #>>43970198 #>>43970282 #>>43970314 #>>43970343 #>>43970418 #>>43970419 #>>43970431 #>>43970434 #>>43970451 #>>43970472 #>>43970541 #>>43970904 #>>43971268 #>>43971299 #>>43971387 #>>43971586 #>>43988717 #
ratatoskrt ◴[] No.43970008[source]
To be fair, Git itself is a bit of a pain, and GitHub's main achievement is/was to make it somewhat bearable.
replies(3): >>43970020 #>>43970066 #>>43970187 #
1. spookie ◴[] No.43970187[source]
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.
replies(3): >>43970280 #>>43970348 #>>43970388 #
2. baq ◴[] No.43970280[source]
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.

replies(2): >>43970414 #>>43988211 #
3. tester756 ◴[] No.43970348[source]
No, git's CLI is terrible mess.
4. jamienicol ◴[] No.43970388[source]
That problem is solved by preventing forced pushes. Rewriting history locally is encouraged.
replies(1): >>43970859 #
5. mkesper ◴[] No.43970414[source]
The modern workflow is just to let GitHub squeeze yor shit commits into one and then rebasing that.
replies(3): >>43970622 #>>43971671 #>>43976065 #
6. baq ◴[] No.43970622{3}[source]
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 is, we could have done better (and have been) since before git even existed.

7. Tainnor ◴[] No.43970859[source]
Prevent forced pushes on protected branches (develop, main, hotfix etc.). I don't care if somebody force pushes their private feature branch.
replies(1): >>43971661 #
8. cmrdporcupine ◴[] No.43971661{3}[source]
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.

9. cmrdporcupine ◴[] No.43971671{3}[source]
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...

10. vvillena ◴[] No.43976065{3}[source]
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.

replies(1): >>43976294 #
11. baq ◴[] No.43976294{4}[source]
Depends on your commits. If it’s untested noise I’d much rather they’re squashed so bisect doesn’t meander in trash.
replies(1): >>43976506 #
12. vvillena ◴[] No.43976506{5}[source]
Bisecting with --first-parent takes care of this.
13. spookie ◴[] No.43988211[source]
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.