News for hackers. Stuff that matters.
Re:Git-absorb: Git commit –fixup, but automatic by imiric on Wednesday September 25, 2024 @10:04PM (#41653797)
I tried using this tool after seeing recommendations for it, but IME it got the parent commit wrong enough times that the work to undo the damage was more than if I had looked up the commit myself and used `--fixup` instead. So I moved back to this manual workflow pretty quickly.

I prefer having full control over my commit history, and this tool is too much magic for my taste. I'm sure that it could be improved so that mistakes are rare, but I'm not sure I would trust it enough to not have to review its work anyway.

Re:Git-absorb: Git commit –fixup, but automatic by 3eb7988a1663 on Wednesday September 25, 2024 @10:17PM (#41653865)
I use lazygit for this. Keyboard driven TUI which lets you easily re-order/squash commits with minimum fuss. Being able to see them all laid out means no futzing with identifying the right ids.
Re:Git-absorb: Git commit –fixup, but automatic by arcanemachiner on Thursday September 26, 2024 @12:13AM (#41654483)
I love lazygit so much. I use it all the time, and it's constantly improving my workflow.
Re:Git-absorb: Git commit –fixup, but automatic by imiric on Wednesday September 25, 2024 @10:31PM (#41653948)
I rarely refer to commits by their IDs in these cases, though. More often than not I use the relative `HEAD~n`, when it's easy to determine `n` visually. With a few aliases, the manual fixup workflow really doesn't take much effort.
Re:Git-absorb: Git commit –fixup, but automatic by montag on Wednesday September 25, 2024 @11:07PM (#41654154)
This sounds just right.
Re:Git-absorb: Git commit –fixup, but automatic by insane_dreamer on Thursday September 26, 2024 @09:24AM (#41658120)
lazygit also my go-to for this and git in general
Re:Git-absorb: Git commit –fixup, but automatic by adastra22 on Wednesday September 25, 2024 @10:30PM (#41653943)
If it just automatically created the fix up commit and moved it to the proper place in the commit tree, I’d be happy with that. You can then run a one-liner to merge the fix up commits after reviewing.
Re:Git-absorb: Git commit –fixup, but automatic by BeeOnRope on Wednesday September 25, 2024 @11:01PM (#41654112)
That's exactly what it does by default.

Only if you pass --and-rebase does it actually do the autosquash rebase for you.

Re:Git-absorb: Git commit –fixup, but automatic by globular-toast on Thursday September 26, 2024 @02:39AM (#41655192)
The more worrying thing for me is how would you know whether it got it right or wrong? I suspect if you're using it the point is you're not going to go and inspect each commit manually. IMO something that looks right is far more dangerous than something that's merely wrong.
Re:Git-absorb: Git commit –fixup, but automatic by jesseduffield on Thursday September 26, 2024 @07:46PM (#41664789)
Lazygit has its own built-in approach to this problem which is much more strict than what git-absorb does (it explicitly asks for confirmation if there's any ambiguity). There's an extensive writeup about it here: https://github.com/jesseduffield/lazygit/blob/master/docs/de...
Re:Git-absorb: Git commit –fixup, but automatic by dawg on Friday September 27, 2024 @01:15AM (#41666506)
Give git-autofixup a try, never had any incorrect fixup targets with it's hunk-based algorithm.