libgit2

git_diff_commit_as_email

Version:

Create an e-mail ready patch for a commit.

Does not support creating patches for merge commits (yet).

Signature

int git_diff_commit_as_email(git_buf *out, git_repository *repo, git_commit *commit, size_t patch_no, size_t total_patches, uint32_t flags, const git_diff_options *diff_opts);

Parameters

In
out

buffer to store the e-mail patch in

In
repo

containing the commit

In
commit

pointer to up commit

size_t
In
patch_no

patch number of the commit

size_t
In
total_patches

total number of patches in the patch set

uint32_t
In
flags

determines the formatting of the e-mail

In
diff_opts

structure with options to influence diff or NULL for defaults.

Returns

int

0 or an error code

Versions