libgit2.example.describe

The following example partially reimplements the git describe command and some of its options.

These commands should work:

- Describe HEAD with default options (describe) - Describe specified revision (describe master~2) - Describe specified revisions (describe master~2 HEAD~3) - Describe HEAD with dirty state suffix (describe --dirty=*) - Describe consider all refs (describe --all master) - Describe consider lightweight tags (describe --tags temp-tag) - Describe show non-default abbreviated size (describe --abbrev=10) - Describe always output the long format if matches a tag (describe --long v1.0) - Describe consider only tags of specified pattern (describe --match v*-release) - Describe show the fallback result (describe --always) - Describe follow only the first parent commit (describe --first-parent)

The command line parsing logic is simplified and doesn't handle all of the use cases.

Members

Functions

lg2_describe
int lg2_describe(libgit2.types.git_repository* repo, int argc, char** argv)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Structs

describe_options
struct describe_options

describe_options represents the parsed command line options

Meta