libgit2

git_revparse

Version:

Parse a revision string for from, to, and intent. See man gitrevisions or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

Signature

int git_revparse(git_revspec *revspec, git_repository *repo, const char *spec);

Parameters

In
revspec

Pointer to an user-allocated git_revspec struct where the result of the rev-parse will be stored

In
repo

the repository to search in

const char *
In
spec

the rev-parse spec to parse

Returns

int

0 on success, GIT_INVALIDSPEC, GIT_ENOTFOUND, GIT_EAMBIGUOUS or an error code

Versions