News for hackers. Stuff that matters.
Re:Julia Evans: Git rebase, what can go wrong by ksenzee on Monday November 06, 2023 @12:26PM (#38165598)
Only metaphorically, maybe. You can squash merge in lots of cases where a rebase will fail.
Re:Julia Evans: Git rebase, what can go wrong by Izkata on Monday November 06, 2023 @01:25PM (#38166567)
They are essentially rebase+squash, despite the name. There is no actual merge taking place.

And for that matter, you'd manually do a squash with the interactive rebase tool anyway ("git rebase -i").

Re:Julia Evans: Git rebase, what can go wrong by ksenzee on Monday November 06, 2023 @02:25PM (#38167512)
Imagine a feature branch where someone has been keeping it up to date by merging main into it regularly. Now the feature is ready to go into main. You can easily `git merge --squash` that branch into main. You can likely do the same thing manually (as you point out) by running `git rebase -i` if you squash all the commits in the branch. But you’ll never manage to do a genuine rebase, where every commit in the branch gets turned into a clean non-merge commit onto main.
Re:Julia Evans: Git rebase, what can go wrong by paulddraper on Monday November 06, 2023 @02:35PM (#38167680)
FWIW I consider `git rebase -i` to be a "genuine rebase"
Re:Julia Evans: Git rebase, what can go wrong by ksenzee on Monday November 06, 2023 @07:53PM (#38171596)
I do too, except in cases where it’s being used simply as a more complicated UI for `git merge --squash` and there’s no actual “generate a diff and apply it to a different base commit” going on.
Re:Julia Evans: Git rebase, what can go wrong by paulddraper on Monday November 06, 2023 @08:07PM (#38171731)
I think we have a rose by any other name situation.

I call that a rebase.

Re:Julia Evans: Git rebase, what can go wrong by Dylan16807 on Tuesday November 07, 2023 @01:08AM (#38173757)
That's a badly fitting analogy because there's only one type of flower involved. In this situation, they're saying that most things you might do with "rebase -i" are rebases, except for one.

I'll make a math analogy. Technically a rectangle is a trapezoid, but if someone says tries to draw a distinction between rectangles and proper trapezoids, it's not hard to figure out what they mean.

When rebase -i outputs a single commit, that's a degenerate case. There are statements about rebases that are generally true but not true for that specific kind.