git

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	Name struct {
		Old string
		New string
	}
	TextFragments []TextFragment
	IsBinary      bool
	IsNew         bool
	IsDelete      bool
}

type GitRepo

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

func Open

func Open(path string, ref string) (*GitRepo, error)

func (*GitRepo) Branches

func (g *GitRepo) Branches() ([]*plumbing.Reference, error)

func (*GitRepo) Commits

func (g *GitRepo) Commits() ([]*object.Commit, error)

func (*GitRepo) Diff

func (g *GitRepo) Diff() (*NiceDiff, error)

func (*GitRepo) FileContent

func (g *GitRepo) FileContent(path string) (string, error)

func (*GitRepo) FileTree

func (g *GitRepo) FileTree(path string) ([]NiceTree, error)

func (*GitRepo) FindMainBranch

func (g *GitRepo) FindMainBranch(branches []string) (string, error)

func (*GitRepo) LastCommit

func (g *GitRepo) LastCommit() (*object.Commit, error)

func (*GitRepo) Tags

func (g *GitRepo) Tags() ([]*object.Tag, error)

type NiceDiff

type NiceDiff struct {
	Commit struct {
		Message string
		Author  object.Signature
		This    string
		Parent  string
	}
	Stat struct {
		FilesChanged int
		Insertions   int
		Deletions    int
	}
	Diff []Diff
}

A nicer git diff representation.

type NiceTree

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

A nicer git tree representation.

type TagList added in v0.2.2

type TagList []*object.Tag

func (TagList) Len added in v0.2.2

func (self TagList) Len() int

func (TagList) Less added in v0.2.2

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

sorting tags in reverse chronological order

func (TagList) Swap added in v0.2.2

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

type TextFragment

type TextFragment struct {
	Header string
	Lines  []gitdiff.Line
}

Jump to

Keyboard shortcuts

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