News for hackers. Stuff that matters.
Re:Git cherry-pick and revert use 3-way merge by baq on Friday November 10, 2023 @04:27PM (#38224772)
What’s the point of merging messy branches?

If your feature branches have independently working commits, go ahead and branch. Most people’s feature branches are developer diaries instead of potentially releasable products. Merging them would make everyone’s lives worse, so of course they get squashed.

Rebases are a bit weird since they mostly help during bisecting but still require production-ready commits in feature branches.

Re:Git cherry-pick and revert use 3-way merge by naasking on Friday November 10, 2023 @05:05PM (#38225163)
Who is "everyone", in "it would make everyone's lives worse"? Worse in what way, exactly? What quantifiable metric are you using to judge "worse"?

I agree that some feature branches can be developer diaries, but I'm not sure why throwing away the diary is a good thing, and why the repo should only contain "releasable products". Sounds like an aesthetic preference rather than something concrete.

Re:Git cherry-pick and revert use 3-way merge by yencabulator on Friday November 10, 2023 @05:52PM (#38225644)
> why the repo should only contain "releasable products"

This is your chance to learn about git bisect.

Re:Git cherry-pick and revert use 3-way merge by baq on Saturday November 11, 2023 @05:32AM (#38229083)
It’s called continuous delivery: I want the main branch to be in a releasable state always. If it isn’t, tickets are raised and people are paged.
Re:Git cherry-pick and revert use 3-way merge by yencabulator on Friday November 10, 2023 @05:51PM (#38225636)
> still require production-ready commits in feature branches.

I make a point of requiring that anyway. You gotta learn to build incrementally, repeatedly landing squashed mega-commits into main is just a recipe for future pain. To level up as a software developer, learn to create incremental work. git rebase -i is your friend.

Re:Git cherry-pick and revert use 3-way merge by baq on Saturday November 11, 2023 @05:35AM (#38229108)
I’ve had my share of rebase -i and I’ve gotten fed up with it, though GitHub plays no small part in that. Years ago when I worked with gerrit it made more sense. I just stopped caring because of the tool.