Skip to content

relizy / getGitDiff

Function: getGitDiff() ​

getGitDiff(from, to?, cwd?): RawGitCommit[]

Defined in: src/core/git-refs.ts:140

Drop-in replacement for changelogen's getGitDiff, which splits the git log output on ----\n and the subject line on |. A commit body containing a ---- line (GitHub adds --------- before the Co-authored-by: trailers of a squash merge) then loses its trailers and its --name-status file list, and a subject containing | is truncated.

Parameters ​

from ​

string | undefined

to? ​

string = 'HEAD'

cwd? ​

string

Returns ​

RawGitCommit[]

Released under the MIT License.