Hasty Briefsbeta

Bilingual

Editing changes in patch format with Jujutsu

3 days ago
  • #patch-editing
  • #jujutsu-vcs
  • #version-control
  • The author wanted to rename a method in a Jujutsu VCS change but found LSP unreliable for Python.
  • Initial solutions included manual find/replace or using `jj absorb` with `--into`, both being suboptimal.
  • Git offers `git format-patch` and `git am` for editing patches, but Jujutsu lacks these commands.
  • Jujutsu's `jj diffedit` allows editing changes but is limited to line selection without content modification.
  • External merge tools like KDiff3 didn't work well for editing changes in Jujutsu.
  • A custom external tool was created to generate and edit patch files for Jujutsu changes.
  • The script un-applies the original diff and applies the edited version, handling read-only 'left' directories.
  • The tool was registered in Jujutsu's configuration file to be used with `jj diffedit --tool=patch`.
  • This solution allows editing patch files directly in an editor, updating the change with the modified patch.