Email or username:

Password:

Forgot your password?
20 comments
Chris P. :trek_ds9_sisko:#1️⃣

@b0rk I burst out laughing on a call, unmuted, thanks to that third panel. >:(

Kevin Hughes 🐝

@b0rk I lolled at "specific flavour of suffering" 😂

Anthony

@b0rk OMG “the specific flavor of suffering” 😂😂😂

VZ

@b0rk This needs to be expressed more succinctly, but a pretty important advantage of merging is that it preserves semantic information completely lost by rebase, i.e. you can actually see when some feature development has started and ended.

Merging also helps with bisecting, but this is probably out of scope for this overview.

Philip Borenstein

@b0rk
present-day me: UGH so many little commits, let's squash to keep history nice and neat.

future me: seriously? you changed 249 files in one commit?

robryk

@b0rk A difference that was meaningful for me a few times is that they differ in the flavor and amount of suffering one gets to experience during bisection.

Julia Evans

@robryk which one would you say causes more suffering

robryk

@b0rk

Usually squash and merge: when bisect points at a squashed commit or a merge commit one gets much less information (so merge is somewhat better than squash, because you _might_ get a commit on the merged-in branch as a result).

Rebase is much better, _as long as the project wants all commits on the main branch to actually build. If that's not the case, it's the worst (but then the notion of a commit as a version of the software is very degenerated anyway).

Uckermark MacGyver :nonazi:

@b0rk panel 2 and 3 looks slightly confusing to me. The resulting squares (left most, coloured squares) seem to be rather different in panel 2. But then panel 3 emphasises that the resulting files are all the same.

Still appreciate this explanation ! 🙏

Julia Evans

@maxheadroom thanks! will think about how to make it clearer

the reason for the discrepancy is that the **diffs** of the 3 commits are different but the **contents of the files** are the same

Uckermark MacGyver :nonazi:

@b0rk yeah, I figured that from reading the other panels. But visually I found it confusing at first. Maybe keep the content/icons inside the squares equal but the colours different?

Ben Zanin

@b0rk panel three is absolutely iconic. This one is going to last for years and years, I think.

Richard Hendricks

@b0rk Mmmmm, flavoured suffering. Squash your PR branch to 1 commit, then Rebase is what we do.

gullevek ☢️

@b0rk I always go to merge because why hide and destroy your past. A git doesn’t have to look nice it has to represent work history.

Steven Holland

@b0rk I love these explanations. There’s a real art to explaining something in the fewest words possible. Simplicity brings clarity.

steelman

@b0rk

> if you mess up the original commits are still in your branche's history

git reflog to the rescue! No matter which method you choose, the original commits are not removed. Only the branch pointer moves (use tags)(remove them, when you're done or git gc won't be able to free up space)

BTW fixup > squash. See also git commit --fixup and git rebase --autosquash.

@stfn

arky

@b0rk Thank you! This is so much clearer than any of the many other explanations I've tried to read before now.

And I hadn't even heard of squash: I was just trying to understand the difference between merge and rebase... (Yes, I put off learning git about ten years longer than I should've.)

Catboy Cody :v_cat:​:v_bott:​:v_mlm::v_ace:

@b0rk There's a fourth option though: The "student has their first merge conflict, panics and tries to sort it out themself instead of asking for help"-option.

- Checked in conflict-markers: ☑️​
- Checked in backup and temporary checked-out files for git merge-tool: ☑️
- Merge commit that only contained the changes of only one branch ("ours"-strategy wasn't intended): ☑️
- Merge commit that contained the content of a unrelated third branch, but non of the changes of the two merged branches: ☑️

Neil Kandalgaonkar

@b0rk Perfect. What an elegant way to represent commit graphs. And thank you for articulating my dread of merge graphs

A squash + rebase looks almost ideal to me. I'm going to do that more often.

The negatives of squash + rebase look minor to me though. Is a 3000-line PR any better with the other options?

Go Up