Skip to content

Three-way merge when a file changed in the project since the session started #14

Closed

Description

@Kernel-Hunter

Asked on the Product Hunt page: two agents run in two Mudroom sessions on the same project and both edit the same file. The first apply goes through. The second apply then reports that file as a conflict ("project changed since the session started") and leaves it alone, while the other files of that session still apply. Today the only way forward is to merge the file by hand.

Every session keeps the base version the agent started from, so Mudroom has all three sides for a normal three-way merge: base, the project as it is now, and the session's copy.

Possible shape:

  • During apply, for a text file in conflict, try a three-way merge of base, project and work.
  • If it merges cleanly, show the merged result in the review as its own entry and apply it like any other change, with undo.
  • If it doesn't, write nothing and keep today's conflict, maybe with the merge markers available to copy.
  • Binary files, symlinks, mode changes and deletions stay as they are now (conflict, apply by hand).

Hunk apply needs the same check, since a hunk from the session can still land cleanly when the project changed in a different part of the file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions