git

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package git contains implementations of Git objects that are useful to compute the version.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	// Hash of the commit object.
	Hash Hash
	// Author is the original author of the commit.
	Author Signature
	// Committer is the one performing the commit.
	// It might be different from Author.
	Committer Signature
	// Message is the commit message, contains arbitrary text.
	Message string
}

Commit data

type Hash

type Hash string

Hash of commit

func (Hash) Short

func (h Hash) Short() Hash

Short convert the 7 first bytes of the Hash to String

func (Hash) String

func (h Hash) String() string

String return the string representation

type Signature

type Signature struct {
	// Name represents a person name. It is an arbitrary string.
	Name string
	// Email is an email, but it cannot be assumed to be well-formed.
	Email string
	// When is the timestamp of the signature.
	When time.Time
}

Signature is used to identify who and when created a commit or tag.

func (Signature) GoString added in v0.2.0

func (s Signature) GoString() string

GoString makes Signature satisfy the GoStringer interface.

Example
s := &Signature{Name: "Arnaud Deprez", Email: "arnaudeprez@gmail.com", When: time.Date(2019, time.August, 12, 22, 47, 0, 0, time.UTC)}
fmt.Printf("%#v\n", s)
Output:

git.Signature{Name: "Arnaud Deprez", Email: "arnaudeprez@gmail.com", When: "2019-08-12 22:47:00 +0000 UTC"}

type Tag

type Tag struct {
	// Hash of the tag.
	Hash Hash
	// Name of the tag.
	Name string
	// Tagger is the one who created the tag.
	Tagger Signature
	// Message is an arbitrary text message.
	Message string
}

Tag is data of git-tag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL