Skip to content

fix: commit message not loaded after cherry-pick/revert with --no-commit - #2858

Merged
love-linger merged 2 commits into
sourcegit-scm:developfrom
JC-Chung:fix/merge-msg-without-in-progress
Nov 6, 2026
Merged

love-linger merged 2 commits into
sourcegit-scm:developfrom
JC-Chung:fix/merge-msg-without-in-progress

Conversation

@JC-Chung

@JC-Chung JC-Chung commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Since 61e9fcc, the commit message box stays empty after git cherry-pick -n or git revert -n without conflicts. These commands create no in-progress marker (CHERRY_PICK_HEAD / REVERT_HEAD), but git still writes the message to .git/MERGE_MSG for a later git commit.

The refactor moved LoadCommitMessageFromFile(MERGE_MSG) behind the _inProgressContext == null early return, so it is never read in this case.

Fix

Try loading MERGE_MSG inside the _inProgressContext == null branch before clearing the stale auto-loaded message. The clearing logic is preserved and only runs when MERGE_MSG is absent or empty.

@love-linger

Copy link
Copy Markdown
Collaborator

Your PR has an issue. For example:

  1. Cherry-pick without commit
  2. Re-edit the commit message
  3. Refresh by pressing F5

@love-linger
love-linger merged commit 4f18ef1 into sourcegit-scm:develop Nov 6, 2026
8 checks passed
@JC-Chung
JC-Chung deleted the fix/merge-msg-without-in-progress branch November 6, 2026 13:12
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.

2 participants