Skip to content

Commit

Permalink
cli: add "absorb" machinery and command
Browse files Browse the repository at this point in the history
The destination commits are selected based on annotation, which I think is
basically the same as "hg absorb" (except for handling of consecutive hunks.)
However, we don't compute a full interleaved delta right now, and the hunks are
merged in the same way as "jj squash". This means absorbed hunks might produce
conflicts if no context lines exist. Still I think this is more intuitive than
selecting destination commits based on patch commutativity.

I've left inline comments to the tests where behavior is different from "hg
absorb", but these aren't exhaustively checked.

Closes martinvonz#170
  • Loading branch information
yuja committed Nov 9, 2024
1 parent e96d968 commit 7dcf33d
Show file tree
Hide file tree
Showing 7 changed files with 1,854 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* The `jj desc` and `jj st` aliases are now hidden to not interfere with shell
completion. They remain available.

* New command `jj absorb` that moves changes to stack of draft revisions.

* New command `jj util exec` that can be used for arbitrary aliases.

### Fixed bugs
Expand Down
Loading

0 comments on commit 7dcf33d

Please sign in to comment.