procedure
commit_to_amendupdate_refauthorcommittermessage_encodingmessageid:oid?commit_to_amend:commit?
This creates a new commit that is exactly the same as the old commit, except that any non-NULL values will be updated. The new commit has the same parents as the old commit.
The update_ref value works as in the regular git_commit_create(), updating the ref to point to the newly rewritten commit. If you want to amend a commit that is not currently the tip of the branch and then rewrite the following commits to reach a ref, pass this as NULL and update the rest of the commit chain and ref separately.
Unlike git_commit_create(), the author, committer, message, message_encoding, and tree parameters can be NULL in which case this will use the values from the original commit_to_amend.
All parameters have the same meanings as in git_commit_create().
procedure
( git_commit_bodycommit)→string?
commit:commit?
The returned message is the body of the commit, comprising everything but the first paragraph of the message. Leading and trailing whitespaces are trimmed.
procedure
repoupdate_refauthorcommittermessage_encodingmessagetreeparent_countid:oid?repo:repository?author:signature?committer:signature?message:string?tree:tree?parent_count:exact-positive-integer?
The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.
procedure
repoauthorcommittermessage_encodingmessagetreeparent_countout:buf?repo:repository?author:signature?committer:signature?message:string?tree:tree?parent_count:exact-positive-integer?
Create a commit as with git_commit_create() but instead of writing it to the objectdb, write the contents of the object into a buffer.
procedure
repoupdate_refauthorcommittermessage_encodingmessagetreeparent_cbid:oid?repo:repository?author:signature?committer:signature?message:string?tree:oid?parent_cb:git_commit_parent_callback
See documentation for git_commit_create() for information about the parameters, as the meaning is identical excepting that tree takes a git_oid and doesn’t check for validity, and parent_cb is invoked with parent_payload and should return git_oid values or NULL to indicate that all parents are accounted for.
procedure
repoupdate_refauthorcommittermessage_encodingmessagetreeparent_countid:oid?repo:repository?author:signature?committer:signature?message:string?tree:oid?parent_count:size_tparents:(cpointeroid)
See documentation for git_commit_create() for information about the parameters, as the meaning is identical excepting that tree and parents now take git_oid. This is a dangerous API in that nor the tree, neither the parents list of git_oids are checked for validity.
procedure
repoupdate_refauthorcommittermessage_encodingmessagetreeid:oid?repo:repository?author:signature?committer:signature?message:string?tree:tree?parent_count:exact-positive-integer?
The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.
The parents for the commit are specified as a variable list of pointers to const git_commit *. Note that this is a convenience method which may not be safe to export for certain languages or compilers
All other parameters remain the same as git_commit_create().
procedure
repocommit_contentsignatureout:oid?repo:repository?commit_content:string?signature:string?
Given the unsigned commit object’s contents, its signature and the header field in which to store the signature, attach the signature to the commit and write it into the given repository.
’signature_field’ defaults to "gpgsig"
procedure
signed_datarepocommit_idsignature:buf?signed_data:buf?repo:repository?commit_id:oid?
If the id is not for a commit, the error class will be GITERR_INVALID. If the commit does not have a signature, the error class will be GITERR_OBJECT.
’field’ defaults to "gpgsig"
procedure
( git_commit_freecommit)→void?
commit:commit?
This is a wrapper around git_object_free()
IMPORTANT: It is necessary to call this method when you stop using a commit. Failure to do so will cause a memory leak.
The returned object should be released with git_commit_free when no longer needed.
repo:repository?id:oid?
The returned object should be released with git_commit_free when no longer needed.
procedure
( git_commit_messagecommit)→string?
commit:commit?
The returned message will be slightly prettified by removing any potential leading newlines.
procedure
( git_commit_message_encodingcommit)→string?
commit:commit?
The encoding may be NULL if the encoding header in the commit is missing; in that case UTF-8 is assumed.
procedure
( git_commit_message_rawcommit)→bytes?
commit:commit?
th generation ancestor of the named commit object, following only the first parents. The returned commit has to be freed by the caller.
Passing 0 as the generation number returns another instance of the base commit itself.
procedure
( git_commit_parentcountcommit)→integer?
commit:commit?
procedure
( git_commit_raw_headercommit)→string?
commit:commit?
procedure
( git_commit_summarycommit)→string?
commit:commit?
The returned message is the summary of the commit, comprising the first paragraph of the message with whitespace trimmed and squashed.
procedure
( git_commit_time_offsetcommit)→integer?
commit:commit?