On this page:
git_  blame_  buffer
git_  blame_  file
git_  blame_  free
git_  blame_  get_  hunk_  byindex
git_  blame_  get_  hunk_  byline
git_  blame_  get_  hunk_  count
git_  blame_  init_  options
8.12

2 Blame🔗ℹ

 (require libgit2/include/blame) package: libgit2

procedure

(git_blame_buffer reference    
  buffer    
  buffer_len)  blame?
  reference : blame?
  buffer : string?
  buffer_len : size_t
Get blame data for a file that has been modified in memory. The reference parameter is a pre-calculated blame for the in-odb history of the file. This means that once a file blame is completed (which can be expensive), updating the buffer blame is very fast.

Lines that differ between the buffer and the committed version are marked as having a zero OID for their final_commit_id.

procedure

(git_blame_file repo path options)  blame?

  repo : repository?
  path : string?
  options : (or/c blame_options? #f)
Get the blame for a single file.

procedure

(git_blame_free blame)  void?

  blame : blame?
Free memory allocated by git_blame_file or git_blame_buffer.

procedure

(git_blame_get_hunk_byindex blame index)

  (or/c git_blame_hunk? #f)
  blame : blame?
  index : uint32_t
Gets the blame hunk at the given index.

Returns #f on error.

procedure

(git_blame_get_hunk_byline blame lineno)  integer?

  blame : blame?
  lineno : size_t
Gets the hunk that relates to the given line number in the newest commit.

Returns #f on error.

procedure

(git_blame_get_hunk_count blame)  exact-positive-integer?

  blame : blame?
Gets the number of hunks that exist in the blame structure.

procedure

(git_blame_init_options opts int)  integer?

  opts : blame_options?
  int : unsigned
Initializes a git_blame_options with default values. Equivalent to creating an instance with GIT_BLAME_OPTIONS_INIT.