Skip to content

Support confirmation for changing immutable commits - #720

Open
nikosavola wants to merge 4 commits into
idursun:mainfrom
nikosavola:nikosavola/push-xysqrouvwokx
Open

Support confirmation for changing immutable commits#720
nikosavola wants to merge 4 commits into
idursun:mainfrom
nikosavola:nikosavola/push-xysqrouvwokx

Conversation

@nikosavola

Copy link
Copy Markdown
Contributor

Right now only edit has a way to retry against an immutable commit (the alt+e force-edit binding). Everything else (split, describe, squash, rebase, ...) just fails with no way to recover short of leaving the TUI.

This adds a generic fix: when any jj command fails with jj's "commit is immutable" error, jjui pops up a confirmation dialog offering to retry the same command with --ignore-immutable.

  • jj.IsImmutableError detects the failure (and specifically excludes the root-commit error, which the flag can't bypass anyway)
  • CommandCompletedMsg grows a lazy Retry field; shared helpers build the retry command for both the buffered and interactive (pty)
    command paths
  • new confirmation dialog (internal/ui/immutable), defaults to "No" since it can pop up unattended, one-shot guarded so a held key can't
    fire it twice

@nikosavola
nikosavola requested a review from idursun as a code owner July 31, 2026 07:01
@nikosavola
nikosavola force-pushed the nikosavola/push-xysqrouvwokx branch from 60f4e3b to ac2e7e9 Compare July 31, 2026 07:01
Shows a confirmation dialog offering to retry with --ignore-immutable
whenever a jj command fails because the target commit is immutable,
instead of requiring a per-action force keybinding (previously only
edit had one).
@nikosavola
nikosavola force-pushed the nikosavola/push-xysqrouvwokx branch from ac2e7e9 to b3c4ddb Compare July 31, 2026 07:15
@nickchomey

Copy link
Copy Markdown
Contributor

This would be a significant improvement

@idursun

idursun commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Hey thanks

Everything else (split, describe, squash, rebase, ...) just fails with no way to recover short of leaving the TUI.

What do you mean here? We have alt+enter which adss this flag automatically.

@nikosavola

Copy link
Copy Markdown
Contributor Author

Hey thanks

Everything else (split, describe, squash, rebase, ...) just fails with no way to recover short of leaving the TUI.

What do you mean here? We have alt+enter which adss this flag automatically.

I think my alt+enter has been bound to a shortcut to open a terminal split and I missed this...

This PR offers a different way, I guess they could coexist but I understand if that seems unnecessary.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants