4 ms·
That works. My habit is to make the fix, commit it as "!fixup whatever", start an interactive rebase, move the fixup commit just after the bad commit (M-↑), pr
by jpeloquin 6y ago
That works. My habit is to make the fix, commit it as "!fixup whatever", start an interactive rebase, move the fixup commit just after the bad commit (M-↑), press f on the fixup commit to tell rebase to merge it with the bad commit, and run the rebase (C-c C-c). This is pretty much the same method as yours, but committing first means the fixup will still be there if you have to cancel & redo the rebase for some reason, such as unexpected and confusing merge conflicts.
- shepmaster 6y agoRight, that process is what I do now, outside of Magit. The point of this article is a tool that (attempts to) automatically find the correct commit to combine with. Conceptually it removes the effort taken to move the fixup commit to the right spot; both keystroke-wise and mental effort wise. 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.
- globular-toast 6y ago> move the fixup commit just after the bad commit (M-↑), press f on the fixup commit to tell rebase to merge it with the bad commit, 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.
- shepmaster 6y ago> using --fixup 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.
- globular-toast 6y agoYeah, it does require you to think about it. But magit has really quick and easy diffing and blame so it can make it significantly easier. In practice I rarely have to think very hard before knowing which commit to fixup.
- jpeloquin 6y agoSo I guess what I should be doing is make fix → magit-blame to get the commit ID for the last prior edit → copy commit ID or message to clipboard → magit commit with `c F`, C-s to the commit ID I just copied, and C-c C-c to set up and run the autosquash rebase.
- shepmaster 6y agoThis process is what I think the article describes and what I’m curious if can be automated by magit itself.
- jpeloquin 6y agoMagit appears to have an integration with 'git absorb'. The issue that tracked the integration discussed git absorb as providing similar function to git autofixup. I don't particularly desire unsupervised changes to my commit history though so don't plan on looking into it further. https://github.com/magit/magit/issues/3053 https://github.com/magit/magit/issues/3053