Documentation
¶
Overview ¶
Package gitdiff ports bat's diff module: it computes per-line modifications (added / removed / modified) between a file's working-tree state and the git index, so the printer can draw change markers in the gutter. It shells out to the git CLI with -U0 and parses the resulting hunk headers, mirroring the classification libgit2 performs in upstream bat.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LineChange ¶
type LineChange int
LineChange classifies a single line's git status.
const ( Added LineChange = iota RemovedAbove RemovedBelow Modified )
type LineChanges ¶
type LineChanges map[int]LineChange
LineChanges maps 1-based line numbers to their change kind.
func Get ¶
func Get(filename string) LineChanges
Get returns the line changes for filename, or nil if it is not in a git repository or git is unavailable.
Click to show internal directories.
Click to hide internal directories.