Skip to content

implement but resolve #11102

@schacon

Description

@schacon

Currently there is no way to go into resolution mode from the CLI, only the GUI.

Let's say we have a conflict at the bottom of our commit stack:

❯ but status
╭┄00 [Unassigned Changes]
┊
┊╭┄t6 [sc-branch-29] (#66)
┊●   38e9fac awesome stuff
┊◐   868c14b worktree change v1
┊◐   4698f1c got some issues  {conflicted}
├╯
┊
● 204e309 (common base) [origin/main] 2025-07-06 08:10:34 +0200 Merge pull request #10 from schacon/sc-description

We need to:

  • get into "resolve" mode
  • see what is still left to resolve
  • commit the resolution
❯ but resolve 4698f1c
Checking out conflicted commit 4698f1c
You are now in edit mode - resolve all conflicts and finalize with `but resolve finish`
  or cancel with `but resolve cancel`
  view remaining issues with `but resolve status`

Conflicted files remaining:
  - app/controllers/bookmarks_controller.rb
  - app/models/bookmark.rb

❯ but status
You are in edit mode - resolve all conflicts and finalize with `but resolve finish`
  or cancel with `but resolve cancel`
  view remaining issues with `but resolve status`

Conflicted files remaining:
  - app/controllers/bookmarks_controller.rb
  - app/models/bookmark.rb

❯ (edit app/models/bookmark.rb)

❯ but resolve status
Resolved files:
  - app/models/bookmark.rb
  
Conflicted files remaining:
  - app/controllers/bookmarks_controller.rb
  
❯ but resolve finish
The following files are still in a conflicted state:
  - app/controllers/bookmarks_controller.rb

Would you like me to save the current conflict state or cancel the finish?
  1. Save partial conflict resolution
  2. Go back to editing
  (2)

❯ (edit app/controllers/bookmarks_controller.rb)

❯ but resolve finish
Saved resolved state of commit 4698f1c -> 6b92044
Rebasing remaining commits...
  - 42b004 -> 6d82fcf worktree change v1
  - 047e7d -> 79497a awesome stuff

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIThe command-line program `but`

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions