News for hackers. Stuff that matters.
Re: by Too on Wednesday November 16, 2022 @12:47AM (#33619375)
In git you do this like git commit --fixup hashtofix && git rebase -i --autosquash hashtofix^

Hard to discover and remember but once you do it usually works smoothly.

Re: by jordigh on Wednesday November 16, 2022 @01:33AM (#33619651)
No, the point is that you don't have to mention the hash at all, it's automatically deduced by diff context.
Re: by raimue on Wednesday November 16, 2022 @06:05AM (#33621333)
There is git-fixup, which provides the 'git fixup' command that makes suggestions to which commit the currently staged changes should be added.

https://github.com/keis/git-fixup

git-fixup will add fixup! commits, so it still needs the mentioned 'git rebase -i --autosquash' afterwards. Usually you do not even need to give it a specific commit if your branch is set to track an upstream branch.

Re: by jordigh on Wednesday November 16, 2022 @08:09AM (#33622353)
Still not quite the same, because absorb splits up your working directory changes into all relevant commits, as deduced by diff context.
Re: by hakre on Wednesday November 16, 2022 @11:20AM (#33625643)
Staged or unstaged? Sounds interesting, will give it a try. Thanks for the details.
Re: by hakre on Wednesday November 16, 2022 @11:54PM (#33635131)
Dipped into it.

Staged changes, excluding renames.

So git-fixup and git-absorb will now happily live together for the moment on my box.

Made a good first impression, thanks again for the reference.

Re: by mhw on Wednesday November 16, 2022 @08:47AM (#33622789)
Or git commit --fixup=:/<pattern> to find the most recent commit with pattern in the message. Still going to give git-absorb a try though.