libgit2

git_commit_create_cb

Version:

Commit creation callback: used when a function is going to create commits (for example, in git_rebase_commit) to allow callers to override the commit creation behavior. For example, users may wish to sign commits by providing this information to git_commit_create_buffer, signing that buffer, then calling git_commit_create_with_signature. The resultant commit id should be set in the out object id parameter.

Signature

typedef int git_commit_create_cb(git_oid *out, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit **parents, void *payload);

Parameters

In
out

pointer that this callback will populate with the object id of the commit that is created

In
author

the author name and time of the commit

In
committer

the committer name and time of the commit

const char *
In
message_encoding

the encoding of the given message, or NULL to assume UTF8

const char *
In
message

the commit message

In
tree

the tree to be committed

size_t
In
parent_count

the number of parents for this commit

In
parents

the commit parents

void *
In
payload

the payload pointer in the rebase options

Returns

int

0 if this callback has created the commit and populated the out parameter, GIT_PASSTHROUGH if the callback has not created a commit and wants the calling function to create the commit as if no callback had been specified, any other value to stop and return a failure

Versions