5 comments

[ 2.9 ms ] story [ 28.1 ms ] thread
I like the look of this. I’ve definitely used git-format-patch and git-am directly so I can edit the diffs directly. Diffing diffs can be fun too. A couple of times in complex rebasings I’ve even needed to go to the point of diffing diff diffs, which is perhaps taking it a bit too far.

Another handy extension in this general space is git-revise <https://github.com/mystor/git-revise>, which is roughly git-rebase but without touching the working tree. I use it regularly in crafting artisanal history.

Is this similar to git add -e? I have a hard time keeping diffs valid when editing.

I use git-revise a lot but it doesn't cover all my use cases. Maybe this will be useful.

Yes it is similar, however it targets editing commits that already exist instead of operating on the index or worktree.
While `git add --patch` and `git add --interactive` have somewhat steep learning curves, they do offer the ability to edit hunks of diffs without needing to pretend you are writing an email to yourself.