Simplify commit message prompts to single-line format

Change the commit message generation prompts from requesting
50/72-rule multi-line messages to single-line subjects only.
This avoids unnecessary body text in automated commits and
ensures the first line is always used via `.split("\n")[0]`.
This commit is contained in:
Chris Wanstrath 2026-02-23 20:35:43 -08:00
parent 4c1530760c
commit 1d7f60b50c

View File

@ -97,10 +97,10 @@ async function squashCommit(branch: string, cwd: string): Promise<void> {
if (diff.trim()) { if (diff.trim()) {
const gen = await vm.claudePipe( const gen = await vm.claudePipe(
diff, diff,
"write a commit message for these changes following the 50/72 rule: subject line ≤50 chars, blank line, body wrapped at 72 chars. the body should briefly explain what changed and why. output only the message, no quotes or extra text.", "write a single-line commit message for these changes, max 50 characters. no body, no blank line, just the subject. output only the message, no quotes or extra text.",
) )
if (gen.exitCode === 0 && gen.stdout.trim()) { if (gen.exitCode === 0 && gen.stdout.trim()) {
await git.commit(gen.stdout.trim(), cwd) await git.commit(gen.stdout.trim().split("\n")[0], cwd)
return return
} }
} }
@ -133,7 +133,7 @@ export async function saveChanges(worktree: string, branch: string, message?: st
const gen = await vm.claudePipe( const gen = await vm.claudePipe(
diff, diff,
"write a commit message for these changes following the 50/72 rule: subject line ≤50 chars, blank line, body wrapped at 72 chars. the body should briefly explain what changed and why. output only the message, no quotes or extra text.", "write a single-line commit message for these changes, max 50 characters. no body, no blank line, just the subject. output only the message, no quotes or extra text.",
) )
if (gen.exitCode !== 0) { if (gen.exitCode !== 0) {