Skip to content

Conversation

@YuriNachos
Copy link

Summary

  • When using r to reword a commit message and pressing ESC, the message is now preserved
  • This makes reword mode consistent with normal commit behavior
  • Simple one-line change: PreserveMessage: falsePreserveMessage: true

Changes

  • Modified reword() method in pkg/gui/controllers/local_commits_controller.go
  • Changed PreserveMessage flag from false to true

Motivation

Fixes #5183 - users often need to press ESC to look at changes while editing a commit message, and the message was lost when returning to reword mode

Test manual

  1. Select any commit
  2. Press r (reword)
  3. Change message to "Test message 123"
  4. Press ESC
  5. Select the same commit again
  6. Press r

Expected: Message "Test message 123" is present ✅

Behavior note

  • The preserved message is stored in .git/LAZYGIT_PENDING_COMMIT (same file as normal commit)
  • If you reword multiple commits, only the last message is preserved
  • This is consistent with how normal commit mode works

Checklist

  • Code compiles (go build)
  • Code formatted with gofumpt
  • Commit message follows conventional commits

When using 'r' to reword a commit message and pressing ESC,
the message is now preserved, consistent with normal commit
behavior.

Fixes jesseduffield#5183
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.

Reword mode loses commit message when escaped

1 participant