Skip to content

Conversation

Byron
Copy link
Collaborator

@Byron Byron commented Aug 18, 2025

With stashing available, a single-branch aware version of branch apply and unapply is possible.

Tasks

  • add missing snapshot tests/fix snapshotting
  • formulate rules
  • impl TBD

Rules

  • The workspace is a conflict-free zone
    • nothing that operates on the conflict must write conflicts into the index.
      This is as conflicts are currently hidden from view.
  • Symmetry
    • If apply is doing something, then unapply undoes exactly that, or in other words State + apply + unapply == State

Thus:

  • snapshots of worktree changes will be made to apply by forcing merge-conflicts to be... auto-resolved.
    This is a problem, but we can't have conflicts as the UI doesn't show them right now, nor does it allow interacting with them.

Research

Unapply: Assignments - with stashing

  • uncommitted but assigned changes should create a snapshot commit
  • when applying the same branch this snapshot is applied

However, the user should be able to interact with these.

Unapply: Assignments - with WIP commit

  • uncommitted but assigned changes should create a WIP commit
    • or just unassign these assignments and they are back in the unassigned changes of the workspace
  • MVP apply: do nothing with the WIP commit
  • final version: apply restores the assignments from the WIP commit (which then is tracked with metadata)

Unapply with worktree changes

  • worktree changes that don't re-apply cleanly

Possible Follow-Ups

  • Find a way to display and handle conflicts in the UI (Gitizen).
    • this would allow us to write conflicts as well and deal with them.
  • Conflict handling TBD

Copy link

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
gitbutler-components Ready Ready Preview Comment Aug 18, 2025 8:40am

@vercel vercel bot temporarily deployed to Preview – gitbutler-components August 18, 2025 06:42 Inactive
Copy link

vercel bot commented Aug 18, 2025

@Byron is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@Byron Byron mentioned this pull request Aug 18, 2025
12 tasks
@Byron Byron marked this pull request as ready for review August 18, 2025 08:43
@Byron Byron enabled auto-merge (rebase) August 18, 2025 08:44
@Byron Byron merged commit abcb145 into gitbutlerapp:master Aug 18, 2025
20 of 21 checks passed
@Byron Byron mentioned this pull request Aug 18, 2025
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant