GitDiff v0.6.3 GitDiff.Chunk View Source

Every patch generated by a 'git diff' command contains one or more chunks

Link to this section Summary

Types

t()

Defines the Chunk struct.

Link to this section Types

Link to this type

t()

View Source
t() :: %GitDiff.Chunk{
  context: String.t(),
  from_num_lines: String.t(),
  from_start_line: String.t(),
  header: String.t(),
  lines: [GitDiff.Line.t()],
  to_num_lines: String.t(),
  to_start_line: String.t()
}

Defines the Chunk struct.

  • :from_start_line - The line at which this chunk began preimage.
  • :to_start_line - The line at which this chunk began postimages.
  • :from_num_lines - The number of lines in the file preimage.
  • :to_num_lines - The number of lines in the file postimages.
  • :header - The header indicating the format and the file names.
  • :lines - The lines of text contained within this chunk of changes. See GitDiff.Line.
  • :context - The extracted context from the header if there is one. A blank string otherwise.