Re: Feature Request: Interactively pick fixup revision

Kristoffer Haugsbakk
2024-11-09T17:13:38Z

On Sat, Nov 9, 2024, at 15:55, Matěj Cepl wrote:
> On Sat Nov 9, 2024 at 12:41 PM CET, Martin Imre wrote:
>> My usual workflow is using `git commit --fixup <revision>` quite
>> frequently, as it eases the code reviewing process and allows for a
>> clean history later on.
>
> https://github.com/keis/git-fixup/
>
> but at least as a minimal improvement, I would limit list of
> commits to those which are touched in the staging area:
>
> ref=$(git log --oneline -- $(git diff --cached|lsdiff --strip
> 1)|fzf|cut -d ' ' -f1)
>
> (lsdiff is from patchutils)

This or git-absorb(1) (I have only tried the latter) is good if you want
to fixup previously touched lines. That is likely to be the case for a
fixup command. But maybe you for example want to add a test to some
change which is in a different file. In which case you want to pick the
commit manually.

I haven’t heard of lsdiff(1) though. That’s something I have been
wanting lately. Thanks.

--
Kristoffer Haugsbakk