Skip to content

Commit 075e0b6

Browse files
committed
Bold the first line of commit messages in generated markdown
- first line of the commit message should be wrapped in **[first line of the commit message]** └── apps └── editor └── src ├── utils │ ├── ascii-tree │ │ └── ascii-tree.ts │ └── git-repository-utils.ts └── views └── prompt └── backend └── utils └── symbols ├── fragment │ └── replace-fragment-symbol.ts ├── git │ └── replace-git-symbols.ts ├── image │ └── replace-image-symbol.ts ├── pasted-text │ └── replace-pasted-text-symbol.ts ├── replace-symbols.ts ├── saved-context │ └── replace-saved-context-symbol.ts ├── selection │ └── replace-selection-symbol.ts ├── skill │ └── replace-skill-symbol.ts └── website └── replace-website-symbol.ts
1 parent a3d0f55 commit 075e0b6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎apps/editor/src/views/prompt/backend/utils/symbols/git/replace-git-symbols.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,16 @@ const build_commit_changes_markdown = (
410410
if (changes_content) {
411411
const short_hash = commit_hash.substring(0, 7)
412412
const title_text = `Commit ${short_hash}`
413-
const msg_text = commit_message ? `${commit_message}\n\n` : ''
413+
let msg_text = ''
414+
if (commit_message) {
415+
const trimmed = commit_message.trim()
416+
if (trimmed) {
417+
const lines = trimmed.split('\n')
418+
const first_line = `**${lines[0].trim()}**`
419+
const rest = lines.slice(1).join('\n')
420+
msg_text = `${rest ? `${first_line}\n${rest}` : first_line}\n\n`
421+
}
422+
}
414423
return `# ${title_text}\n\n${msg_text}${changes_content}`
415424
}
416425
return ''

0 commit comments

Comments
 (0)