git

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Branches added in v1.2.1

func Branches(repo *git.Repository) ([]*plumbing.Reference, error)

func FindMainBranch added in v1.2.1

func FindMainBranch(repo *git.Repository, branches []string) (string, error)

func GitwebCategory added in v1.2.1

func GitwebCategory(repo *git.Repository) string

GitwebCategory returns category text. See https://git-scm.com/docs/gitweb#Documentation/gitweb.txt-categoryorgitwebcategory

func GitwebDescription added in v1.2.1

func GitwebDescription(repo *git.Repository) string

GitwebDescription returns description text. See https://git-scm.com/docs/gitweb#Documentation/gitweb.txt-descriptionorgitwebdescription

func WriteTar added in v1.2.1

func WriteTar(w io.Writer, prefix string, tree *object.Tree) error

WriteTar writes itself from a tree into a binary tar file format. prefix is root folder to be appended.

Types

type CommitsOptions

type CommitsOptions struct {
	// Limit is maximum number of commits to retrieve.
	// 0 means no limit.
	Limit uint32

	Before plumbing.Hash
	After  plumbing.Hash
}

type CommitsPageMeta

type CommitsPageMeta struct {
	HasNextPage bool
	HasPrevPage bool
}

func Commits added in v1.2.1

func Commits(repo *git.Repository, rev plumbing.Hash, opts CommitsOptions) ([]*object.Commit, CommitsPageMeta, error)

type NiceDiff

type NiceDiff struct {
	Commit *object.Commit
	Parent *object.Commit
	Stat   struct {
		FilesChanged int
		Insertions   int
		Deletions    int
	}
	Files []*gitdiff.File
}

A nicer git diff representation.

func Diff added in v1.2.1

func Diff(commit *object.Commit) (*NiceDiff, error)

func SystemDiff added in v1.2.1

func SystemDiff(repoPath string, commit *object.Commit) (*NiceDiff, error)

SystemDiff generates diff lines using system git.

type NiceTree

type NiceTree struct {
	Name      string
	Mode      string
	Size      int64
	IsFile    bool
	IsSubtree bool
}

A nicer git tree representation.

func NewNiceTree added in v1.2.1

func NewNiceTree(tree *object.Tree, path string) ([]NiceTree, error)

type TagList

type TagList struct {
	// contains filtered or unexported fields
}

func (*TagList) Len

func (self *TagList) Len() int

func (*TagList) Less

func (self *TagList) Less(i, j int) bool

sorting tags in reverse chronological order

func (*TagList) Swap

func (self *TagList) Swap(i, j int)

type TagReference

type TagReference struct {
	// contains filtered or unexported fields
}

TagReference is used to list both tag and non-annotated tags. Non-annotated tags should only contains a reference. Annotated tags should contain its reference and its tag information.

func Tags added in v1.2.1

func Tags(repo *git.Repository) ([]*TagReference, error)

func (*TagReference) Message

func (t *TagReference) Message() string

func (*TagReference) Name

func (t *TagReference) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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