I’m a casual Magit user, so learning from other users would be very beneficial.
I’m a casual Magit user, so learning from other users would be very beneficial.
That's what --autosquash is for. If you do fixup commits correctly (using --fixup), it will put them in the correct place and mark them as fixups for you.
If I understand you correctly, this requires that I think about which commit I want to fixup. Once identified, I can mark my fixup with what commit it should be combined with automatically.
My understanding of the article is that it attempts to automatically figure out which commit to combine with. That’s the feature that I’m interested in.
That’s what I’m looking for: a Magit-native way to make my little fixups without having to manually track which fixup should be applied where in history.
When you press either of those, magit pops up a commit picker which shows the current git log. Selecting a commit will then instantaneously apply your staged changes to the selected commit. It's much simpler than any of the other workflows I've seen in response to your question.
The gif in this repo (for a tool I made that simulates this behavior as a cli tool for some jealous coworkers) tries to show the workflow: https://github.com/quodlibetor/git-fixup
That said, this _doesn't_ support the "automatically figure out which commits to apply hunks to" workflow. I personally find that I use both workflows depending on the nature of my changes.
I've been meaning to write an article on a fixup workflow for a while now. Just need to find somewhere to host it.