package
0.0.0-20220328024126-2ee2aa9d18c6
Repository: https://github.com/nivl/git-go.git
Documentation: pkg.go.dev
# Functions
New creates a new git object of the given type.
NewBlob returns a new Blob object from a git Object.
NewCommit creates a new Commit object Any provided Oids won't be check.
NewCommitFromObject creates a commit from a raw object
A commit has following format:
tree {sha} parent {sha} author {author_name} <{author_email}> {author_date_seconds} {author_date_timezone} committer {committer_name} <{committer_email}> {committer_date_seconds} {committer_date_timezone} gpgsig -----BEGIN PGP SIGNATURE----- {gpg key over multiple lines} -----END PGP SIGNATURE----- {a blank line} {commit message}
Note: - A commit can have 0, 1, or many parents lines The very first commit of a repo has no parents A regular commit as 1 parent A merge commit has 2 or more parents - The gpgsig is optional.
NewSignature generates a signature at the current date and time.
NewSignatureFromBytes returns a signature from an array of byte
A signature has the following format: User Name <[email protected]> timestamp timezone Ex: Melvin Laplanche <[email protected]> 1566115917 -0700.
NewTag creates a new Tag object.
NewTagFromObject creates a new Tag from a raw git object
A tag has following format:
object {sha} type {target_object_type} tag {tag_name} tagger {author_name} <{author_email}> {author_date_seconds} {author_date_timezone} gpgsig -----BEGIN PGP SIGNATURE----- {gpg key over multiple lines} -----END PGP SIGNATURE----- {a blank line} {tag message}
Note: - The gpgsig is optional.
NewTree returns a new tree with the given entries.
NewTreeFromObject returns a new tree from an object
A tree has following format:
{octal_mode} {path_name}\0{encoded_sha}
Note: - a Tree may have multiple entries.
NewTypeFromString returns an Type from its string representation.
# Constants
ModeDirectory represents the mode to use for a directory.
ModeExecutable represents the mode to use for a executable file.
ModeFile represents the mode to use for a regular file.
ModeGitLink represents the mode to use for a gitlink (submodule).
ModeSymLink represents the mode to use for a symbolic link.
5 is reserved for future use.
List of all the possible object types.
List of all the possible object types.
List of all the possible object types.
List of all the possible object types.
List of all the possible object types.
# Variables
ErrCommitInvalid represents an error thrown when parsing an invalid commit object.
ErrObjectInvalid represents an error thrown when an object contains unexpected data or when the wrong object is provided to a method.
ErrObjectUnknown represents an error thrown when encoutering an unknown object.
ErrSignatureInvalid is an error thrown when the signature of a commit couldn't be parsed.
ErrTagInvalid represents an error thrown when parsing an invalid tag object.
ErrTreeInvalid represents an error thrown when parsing an invalid tree object.
# Structs
Blob represents a blob object.
Commit represents a commit object.
CommitOptions represents all the optional data available to create a commit.
Object represents a git object.
Signature represents the author/committer and time of a commit.
Tag represents a Tag object.
TagParams represents all the data needed to create a Tag Params starting by Opt are optionals.
Tree represents a git tree object.
TreeEntry represents an entry inside a git tree.
# Type aliases
TreeObjectMode represents the mode of an object inside a tree Non-standard modes (like 0o100664) are not supported.
Type represents the type of an object as stored in a packfile.