From 7829bee55c727160311e90eb5b33489a330e7489 Mon Sep 17 00:00:00 2001 From: arookieofc Date: Mon, 9 Nov 2026 10:48:39 +0800 Subject: [PATCH] fix(vcs): edit the full commit message, not only the subject (#2242) A paged Git log only carries each commit's summary line; the Edit Commit Message dialog therefore opened with the body missing, and OK rewrote the commit to the subject alone. Load the full message through loadLogDetails when the commit's messageTruncated flag is set, the same path Copy Commit Message already uses, so the dialog edits subject and body together. Fixes #2238 --- src/features/vcs/rebase.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/features/vcs/rebase.tsx b/src/features/vcs/rebase.tsx index a2bea6484..58a325a1a 100644 --- a/src/features/vcs/rebase.tsx +++ b/src/features/vcs/rebase.tsx @@ -15,6 +15,7 @@ import { stripSlash } from "./model"; import { openCommit } from "./commitUi"; import { rememberSetting } from "./confirmations"; import { confirmDialog, openDialog } from "./dialogs"; +import { loadLogDetails } from "./logDetails"; import { conflictsInstead, inProgress } from "./operations"; import { runGitOperation, runOp, saveAll } from "./ops"; import { @@ -179,8 +180,11 @@ async function runRebase( export async function editCommitMessage(commit: Commit) { const range = await rangeFrom(commit, "edit commit message"); if (!range) return; - const message = await promptMessage(`Edit Commit Message (${short(commit.id)})`, commit.message); - if (message === null || message.trim() === commit.message.trim()) return; + // A paged log only carries the summary line: load the full message so the + // dialog edits subject and body, not the subject alone (#2238). + const initial = commit.messageTruncated ? (await loadLogDetails(commit)).message : commit.message; + const message = await promptMessage(`Edit Commit Message (${short(commit.id)})`, initial); + if (message === null || message.trim() === initial.trim()) return; // Written without a rebase: the index and the working tree (local changes) stay as they are. const change = await runOp(tx`Edit commit message of ${short(commit.id)}`, () => call(commands.vcsReword(range.repo, commit.id, message)),