git

package
v0.0.0-...-c25e923 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package git provides helpers for SCM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

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

Git is a helper for git.

func NewGit

func NewGit() (*Git, error)

NewGit instantiates and returns a Git struct.

func (*Git) AheadBehind

func (g *Git) AheadBehind(ref string) (ahead, behind int, err error)

AheadBehind returns the number of commits that HEAD is ahead and behind relative to the specified ref.

func (*Git) CheckoutPullRequest

func (g *Git) CheckoutPullRequest(number int) (err error)

CheckoutPullRequest checks out pull request.

func (*Git) FetchPullRequest

func (g *Git) FetchPullRequest(remote string, number int) (err error)

FetchPullRequest fetches a remote PR.

func (*Git) HasGPGSignature

func (g *Git) HasGPGSignature() (ok bool, err error)

HasGPGSignature returns the commit message. In the case that a commit has multiple parents, the message of the last parent is returned.

func (*Git) Message

func (g *Git) Message() (message string, err error)

Message returns the commit message. In the case that a commit has multiple parents, the message of the last parent is returned.

func (*Git) Messages

func (g *Git) Messages(commit1, commit2 string) ([]string, error)

Messages returns the list of commit messages in the range commit1..commit2.

func (*Git) SHA

func (g *Git) SHA() (sha string, err error)

SHA returns the sha of the current commit.

func (*Git) VerifyPGPSignature

func (g *Git) VerifyPGPSignature(armoredKeyrings []string) (*openpgp.Entity, error)

VerifyPGPSignature validates PGP signature against a keyring.

Jump to

Keyboard shortcuts

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