News for hackers. Stuff that matters.
Re:Git-absorb: Git commit –fixup, but automatic by dmead on Thursday September 26, 2024 @12:04AM (#41654433)
This sounds great,but kind of an anti pattern in git.

I definitely want to have a "fixes" commit on my feature branch. You should do whatever you want on a feature branch so long as your trunk has a clean history.

This sounds like someone wanted to lift a feature of changesets in mercurial into git. I don't think this is safe and probably breaks a lot of people's mental model of git changelogs being an immutable data structure.

Re:Git-absorb: Git commit –fixup, but automatic by saagarjha on Thursday September 26, 2024 @12:08AM (#41654456)
At some point the changes are going to get merged in, no? And that that point I would really like the commits to be nice.
Re:Git-absorb: Git commit –fixup, but automatic by dmead on Thursday September 26, 2024 @03:36AM (#41655543)
That's why you squash and make the commit message readable.
Re:Git-absorb: Git commit –fixup, but automatic by saagarjha on Thursday September 26, 2024 @03:51AM (#41655656)
Squash all the commits I worked so hard to make atomic?
Re:Git-absorb: Git commit –fixup, but automatic by cryptonector on Thursday September 26, 2024 @12:58PM (#41660684)
No, you don't want to squash everything into one commit. You want logical, clean history.
Re:Git-absorb: Git commit –fixup, but automatic by snatchpiesinger on Thursday September 26, 2024 @04:57AM (#41656113)
git log --first-parent
Re:Git-absorb: Git commit –fixup, but automatic by cryptonector on Thursday September 26, 2024 @12:58PM (#41660677)
This is no more nor less safe than `git rebase`.
Re:Git-absorb: Git commit –fixup, but automatic by keybored on Thursday September 26, 2024 @03:41PM (#41662385)
> I definitely want to have a "fixes" commit on my feature branch. You should do whatever you want on a feature branch so long as your trunk has a clean history.

This tool creates `fixup!` commits. These commits aren’t rewrite commits. They are commits which later can be used to rewrite the history.

You can use this tool, not rewrite your branch, and then rewrite the branch right before merge.

> This sounds like someone wanted to lift a feature of changesets in mercurial into git. I don't think this is safe and probably breaks a lot of people's mental model of git changelogs being an immutable data structure.

Rewriting is a huge part of the Git culture (and well-supported). Meanwhile Mercurial seems to have rewriting as a sort of add-on.