Documentation
¶
Overview ¶
Package gitdiff parses the patch output of
git log -p -U0 --no-renames --format=%x00%H%x00%ct%x00%aN%x00%P
into per-commit, per-file hunks. Unlike internal/parser, which only sees numstat line counts, this keeps the text of every added and deleted line, for analyses that need to know *which* lines changed (e.g. rework).
Index ¶
Constants ¶
const Format = "%x00%H%x00%ct%x00%aN%x00%P"
Format is the --format string Parse expects. Each field is prefixed with a NUL byte, which git never emits at the start of a diff line (a file whose content contains NUL is treated as binary), so a header line can never be confused with patch content.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Commit ¶
type Commit struct {
Rev string
Time time.Time // committer date
Author string
Parents []string
Files []FileDiff
}
Commit is one commit's patch.