On this page:
8.18
top
up

9CommitπŸ”— i

procedure

( git_commit_amend id
commit_to_amend
update_ref
author
committer
message_encoding
message
tree)integer?
id:oid?
commit_to_amend:commit?
update_ref:(or/c string? #f)
author:(or/c signature?#f)
committer:(or/c signature?#f)
message_encoding:(or/c string? #f)
message:(or/c string? #f)
tree:(or/c tree?#f)
Amend an existing commit by replacing only non-NULL values.

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_authorcommit)signature?

commit:commit?
Get the author of a commit.

procedure

( git_commit_bodycommit)string?

commit:commit?
Get the long "body" of the git commit message.

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

( git_commit_committercommit)signature?

commit:commit?
Get the committer of a commit.

procedure

( git_commit_create id
repo
update_ref
author
committer
message_encoding
message
tree
parent_count
parents)integer?
id:oid?
repo:repository?
update_ref:(or/c string? #f)
author:signature?
committer:signature?
message_encoding:(or/c string? #f)
message:string?
tree:tree?
parents:(or/c (cpointercommit)#f)
Create new commit in the repository from a list of git_object pointers

The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.

procedure

( git_commit_create_buffer out
repo
author
committer
message_encoding
message
tree
parent_count
parents)integer?
out:buf?
repo:repository?
author:signature?
committer:signature?
message_encoding:(or/c string? #f)
message:string?
tree:tree?
parents:(or/c (cpointercommit)#f)
Create a commit and write it into a buffer

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

( git_commit_create_from_callback id
repo
update_ref
author
committer
message_encoding
message
tree
parent_cb
parent_payload)integer?
id:oid?
repo:repository?
update_ref:(or/c string? #f)
author:signature?
committer:signature?
message_encoding:(or/c string? #f)
message:string?
tree:oid?
parent_cb:git_commit_parent_callback
parent_payload:(or/c (cpointervoid)#f)
Create a new commit in the repository with an callback to supply parents.

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

( git_commit_create_from_ids id
repo
update_ref
author
committer
message_encoding
message
tree
parent_count
parents)integer?
id:oid?
repo:repository?
update_ref:(or/c string? #f)
author:signature?
committer:signature?
message_encoding:(or/c string? #f)
message:string?
tree:oid?
parent_count:size_t
parents:(cpointeroid)
Create new commit in the repository from a list of git_oid values.

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

( git_commit_create_v id
repo
update_ref
author
committer
message_encoding
message
tree
parent_count)integer?
id:oid?
repo:repository?
update_ref:(or/c string? #f)
author:signature?
committer:signature?
message_encoding:(or/c string? #f)
message:string?
tree:tree?
Create new commit in the repository using a variable argument list.

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

( git_commit_create_with_signature out
repo
commit_content
signature
signature_field)integer?
out:oid?
repo:repository?
commit_content:string?
signature:string?
signature_field:(or/c string? #f)
Create a commit object from the given buffer and signature

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

( git_commit_dupsource)commit?

source:commit?
Create an in-memory copy of a commit. The copy must be explicitly free’d or it will leak.

procedure

( git_commit_extract_signature signature
signed_data
repo
commit_id
field)integer?
signature:buf?
signed_data:buf?
repo:repository?
commit_id:oid?
field:(or/c string? #f)
Extract the signature from a commit

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?
Close an open 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.

procedure

( git_commit_header_fieldoutcommitfield)integer?

out:buf?
commit:commit?
field:string?
Get an arbitrary header field

procedure

( git_commit_idcommit)oid?

commit:commit?
Get the id of a commit.

procedure

( git_commit_lookuprepoid)commit?

repo:repository?
id:oid?
Lookup a commit object from a repository.

The returned object should be released with git_commit_free when no longer needed.

procedure

( git_commit_lookup_prefixrepoidlen)commit?

repo:repository?
id:oid?
Lookup a commit object from a repository, given a prefix of its identifier (short id).

The returned object should be released with git_commit_free when no longer needed.

procedure

( git_commit_messagecommit)string?

commit:commit?
Get the full message of a commit.

The returned message will be slightly prettified by removing any potential leading newlines.

procedure

( git_commit_message_encodingcommit)string?

commit:commit?
Get the encoding for the message of a commit, as a string representing a standard encoding name.

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?
Get the full raw message of a commit.

procedure

( git_commit_nth_gen_ancestorcommitint)commit?

commit:commit?
int:unsigned
Get the commit object that is the <n

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_ownercommit)repository?

commit:commit?
Get the repository that contains the commit.

procedure

( git_commit_parentcommitint)commit?

commit:commit?
int:unsigned
Get the specified parent of the commit.

procedure

( git_commit_parent_idcommitint)oid?

commit:commit?
int:unsigned
Get the oid of a specified parent for a commit. This is different from git_commit_parent, which will attempt to load the parent commit from the ODB.

procedure

( git_commit_parentcountcommit)integer?

commit:commit?
Get the number of parents of this commit

procedure

( git_commit_raw_headercommit)string?

commit:commit?
Get the full raw text of the commit header.

procedure

( git_commit_summarycommit)string?

commit:commit?
Get the short "summary" of the git commit message.

The returned message is the summary of the commit, comprising the first paragraph of the message with whitespace trimmed and squashed.

procedure

( git_commit_timecommit)git_time_t?

commit:commit?
Get the commit time (i.e. committer time) of a commit.

procedure

( git_commit_time_offsetcommit)integer?

commit:commit?
Get the commit timezone offset (i.e. committer’s preferred timezone) of a commit.

procedure

( git_commit_treecommit)tree?

commit:commit?
Get the tree pointed to by a commit.

procedure

( git_commit_tree_idcommit)oid?

commit:commit?
Get the id of the tree pointed to by a commit. This differs from git_commit_tree in that no attempts are made to fetch an object from the ODB.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /