Hasty Briefsbeta

Bilingual

Defeating Git Rigour Fatigue with Jujutsu

4 hours ago
  • #jujutsu
  • #workflow
  • #git
  • Jujutsu (jj) helps manage commits in large feature development but still requires effort and can lead to 'git rigour fatigue'.
  • Common methods like jj absorb and jj squash -i have limitations: absorb assigns changes based on file touch history, while squash can cause merge conflicts if boundaries aren't clean.
  • A proposed solution involves creating an ideal commit history first, using commands like jj new to set up 'messy' commits representing different change types (e.g., red for types, blue for UI).
  • The technique squashes all changes into one commit and then interactively redistributes them into their respective commits using jj squash -i, ensuring each change ends up in the correct place.
  • This workflow allows for improvised commits with temporary states during development, tidying everything up in one sweep at the end, making it easier than maintaining strict git rigour throughout.
  • Compared to jj split, this method handles missed hunks more easily and avoids conflicts by guaranteeing the final 'everything commit' is empty and conflict-free.
  • A downside is that there's no guarantee each commit will compile, which might be a limitation for some development environments.
  • The technique lacks a formal name but is humorously referred to as 'Doing Commits Like A Big Pile Of Laundry'.