Documentation ¶
Index ¶
- func DetectGit(path string) (string, error)
- type Commit
- type Commits
- type Git
- func (g *Git) AddRemote(name, url string) error
- func (g *Git) CheckoutBranch(name string) error
- func (g *Git) CommitsIn(rev string) (Commits, error)
- func (g *Git) CreateBranch(name string) error
- func (g *Git) HEAD() (string, string, error)
- func (g *Git) IsClean() (bool, error)
- func (g *Git) MoveBranch(name string) error
- func (g *Git) Path() (string, error)
- func (g *Git) Pull(ctx context.Context) error
- func (g *Git) Push(ctx context.Context, remoteName string) error
- func (g *Git) PushTag(ctx context.Context, remoteName, tagName string) error
- func (g *Git) Remote(name string) (string, string, error)
- func (g *Git) Submodule(name string) (Submodule, error)
- func (g *Git) Tag(name string) (Tag, error)
- func (g *Git) Tags() (Tags, error)
- func (g *Git) UpdateSubmodules() error
- type Signature
- type Submodule
- type Tag
- type TagType
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Commit ¶
type Commit struct { Hash string Author Signature Committer Signature Message string Parents []string }
Commit represents a Git commit.
func (Commit) Before ¶
Before determines if a given commit is chronologically before another commit.
func (Commit) Equal ¶
Equal determines if two commits are the same. Two commits are the same if they both have the same hash.
func (Commit) ShortMessage ¶
ShortMessage returns a one-line truncated commit message.
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git provides Git functionalities.
func (*Git) CheckoutBranch ¶
CheckoutBranch checks out to a git branch.
func (*Git) CreateBranch ¶
CreateBranch creates a new git branch.
func (*Git) MoveBranch ¶
MoveBranch moves/renames the current branch.
func (*Git) Pull ¶
Pull is same as git pull. It brings the changes from a remote repository into the current branch.
func (*Git) Remote ¶
Remote returns the domain part and path part of a Git remote repository URL. It assumes the remote repository is named origin.
func (*Git) UpdateSubmodules ¶
UpdateSubmodules pulls down and updates all git submodules.
type Signature ¶
Signature determines who and when created a commit or tag.
func (Signature) After ¶
After determines if a given signature is chronologically after another signature.
type Tag ¶
type Tag struct { Type TagType Hash string Name string Tagger *Signature Message *string Commit Commit }
Tag represents a Git tag.
func (Tag) After ¶
After determines if a given tag is chronologically after another tag. Two tags are compared using the commits they refer to.
func (Tag) Before ¶
Before determines if a given tag is chronologically before another tag. Two tags are compared using the commits they refer to.
type Tags ¶
type Tags []Tag
Tags is a list of Git tags.
func (Tags) First ¶
First returns the first tag that satisifies the given predicate. If you pass a nil function, the first tag will be returned.
func (Tags) Last ¶
Last returns the last tag that satisifies the given predicate. If you pass a nil function, the last tag will be returned.