unison icon indicating copy to clipboard operation
unison copied to clipboard

overhaul `update` flow

Open mitchellwrosen opened this issue 5 months ago • 0 comments

Overview

This PR amends the update flow as follows:

  • When an update propagation fails (say on branch main), we create a new "update branch" called update-main. The branch's underlying contents are identical to main, except without any of the definitions being updated, nor any of their transitive dependents.
  • Like merge branches, update branches' unique type guids are reused (if possible) from the parent branch.
  • As on trunk, the scratch file is prepended with a new fold that contains all adds/updates in the original scratch file that the user tried to update with, plus all transitive dependents of the updates.
  • When on an update branch, if an update succeeds, it behaves like a merge.commit: the branch is merged back into its parent and deleted. (A failed update while on an update branch does not create a second update branch).

This new flow effectively allows users to delete definitions more easily during an update, because transitive dependents of a failed update are not left in the underlying namespace on an update branch; they exist only in the scratch file.

The slurp output on an update branch has been updated and modernized to communicate these "effective deletes":

Screenshot 2025-06-06 at 5 52 10 PM

This new update flow is only available if ucm is run with a UNISON_USE_UPDATE_V2= environment variable, so we can dogfood a bit before releasing it for real.

Loose ends

  • "Old slurp" output should be reworked to look like "new slurp" (i.e. old slurp and new slurp should be unified in code)
  • "New slurp" should mention aliases, as old slurp does
  • Remove environment var

mitchellwrosen avatar May 19 '25 14:05 mitchellwrosen