On this page:
git_  annotated_  commit_  free
git_  annotated_  commit_  from_  fetchhead
git_  annotated_  commit_  from_  ref
git_  annotated_  commit_  from_  revspec
git_  annotated_  commit_  id
git_  annotated_  commit_  lookup
8.12

1 Annotated Commit🔗ℹ

 (require libgit2/include/annotated_commit)
  package: libgit2

procedure

(git_annotated_commit_free commit)  void?

  commit : annotated_commit?
Frees a git_annotated_commit.

procedure

(git_annotated_commit_from_fetchhead repo 
  branch_name 
  remote_url 
  id) 
  annotated_commit?
  repo : repository?
  branch_name : string?
  remote_url : string?
  id : oid?
Creates a git_annotated_commit from the given fetch head data. The resulting git_annotated_commit must be freed with git_annotated_commit_free.

procedure

(git_annotated_commit_from_ref repo ref)  annotated_commit?

  repo : repository?
  ref : reference?
Creates a git_annotated_commit from the given reference. The resulting git_annotated_commit must be freed with git_annotated_commit_free.

procedure

(git_annotated_commit_from_revspec repo    
  revspec)  annotated_commit?
  repo : repository?
  revspec : string?
Creates a git_annotated_comit from a revision string.

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

procedure

(git_annotated_commit_id commit)  integer?

  commit : annotated_commit?
Gets the commit ID that the given git_annotated_commit refers to.

procedure

(git_annotated_commit_lookup repo id)  annotated_commit?

  repo : repository?
  id : oid?
Creates a git_annotated_commit from the given commit id. The resulting git_annotated_commit must be freed with git_annotated_commit_free.

An annotated commit contains information about how it was looked up, which may be useful for functions like merge or rebase to provide context to the operation. For example, conflict files will include the name of the source or target branches being merged. It is therefore preferable to use the most specific function (eg git_annotated_commit_from_ref) instead of this one when that data is known.