git

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MPL-2.0 Imports: 13 Imported by: 15

Documentation

Index

Constants

View Source
const AppConfigOrgName = "TimeIncOSS"
View Source
const AppConfigRepoName = "ape-dev-rt-apps"
View Source
const AppConfigRepoUrl = "git@github.com:" + AppConfigOrgName + "/" + AppConfigRepoName + ".git"
View Source
const GitLogTimezone = "Local"

Variables

View Source
var GitLogFormat = "format:" + strings.Join([]string{
	"%h",
	"%s",
	"%an",
	"%ae",
	"%ad",
	"%cn",
	"%ce",
	"%cd",
}, "%n") + "%n%n"

Functions

func GetRepositoryPath

func GetRepositoryPath() (string, error)

Types

type CommitSorter

type CommitSorter []*GitCommit

func (CommitSorter) Len

func (a CommitSorter) Len() int

func (CommitSorter) Less

func (a CommitSorter) Less(i, j int) bool

func (CommitSorter) Swap

func (a CommitSorter) Swap(i, j int)

type Directory

type Directory struct {
	Name       string
	LastCommit *GitCommit
	GitError   error
}

type Git

type Git struct {
	RepositoryURL  string
	RepositoryPath string
	UserInterface  *ui.StreamedUi
}

func NewGit

func NewGit(url, path string) *Git

func (*Git) Checkout

func (g *Git) Checkout(ref string) (string, error)

func (*Git) Clean

func (g *Git) Clean() (string, error)

func (*Git) FreshCheckout

func (g *Git) FreshCheckout(ref string) (string, error)

func (*Git) GetRevision

func (g *Git) GetRevision(ref string) (string, error)

func (*Git) IsIndexDirty

func (g *Git) IsIndexDirty() (bool, error)

func (*Git) LastCommit

func (g *Git) LastCommit(path string) (*GitCommit, error)

func (*Git) ListDirs

func (g *Git) ListDirs() (dirs []*Directory, err error)

func (*Git) Log

func (g *Git) Log(path string, count int) ([]*GitCommit, error)

func (*Git) LogContainsSha

func (g *Git) LogContainsSha(path string, sha string) (bool, error)

func (*Git) Reset

func (g *Git) Reset(args []string) (string, error)

func (*Git) RevParse

func (g *Git) RevParse(args []string) (string, error)

func (*Git) Status

func (g *Git) Status(args []string) (string, error)

func (*Git) Update

func (g *Git) Update() (string, error)

func (*Git) Version

func (g *Git) Version() (string, error)

type GitCommit

type GitCommit struct {
	AbbreviatedSHA string
	Message        string

	AuthorName     string
	AuthorEmail    string
	AuthorshipDate time.Time

	CommitterName  string
	CommitterEmail string
	CommitDate     time.Time
}

Jump to

Keyboard shortcuts

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