Skip to main content

commit_subject

Function commit_subject 

Source
pub fn commit_subject(message: &str) -> String
Expand description

What: The subject Git’s %s prints for a commit message, trimmed as the script trims it: blank lines skipped, the first paragraph’s lines joined by one space, each line without trailing whitespace. Why: The landing holds the commit message, so the subject needs no git log start.

In TS you’d write (pseudocode):

execFileSync('git', ['log', '-1', '--format=%s', sha]).trim()