On this page:
git_  graph_  ahead_  behind
git_  graph_  descendant_  of
8.12

16 Graph🔗ℹ

 (require libgit2/include/graph) package: libgit2

procedure

(git_graph_ahead_behind repo local upstream)  any

  repo : repository?
  local : oid?
  upstream : oid?
Count the number of unique commits between two commit objects

There is no need for branches containing the commits to have any upstream relationship, but it helps to think of one as a branch and the other as its upstream, the ahead and behind values will be what git would report for the branches.

Returns (values (ahead : integer?) (behind : integer?)). See Multiple Values

procedure

(git_graph_descendant_of repo    
  commit    
  ancestor)  boolean?
  repo : repository?
  commit : oid?
  ancestor : oid?
Determine if a commit is the descendant of another commit.