git

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BranchNameRegex = regexp.MustCompile(`spr/([a-zA-Z0-9_\-/\.]+)/([a-f0-9]{8})$`)

Functions

func BranchNameFromCommit added in v0.12.1

func BranchNameFromCommit(cfg *config.Config, commit Commit) string

func GetLocalBranchName added in v0.12.1

func GetLocalBranchName(gitcmd GitInterface) string

GetLocalBranchName returns the current local git branch

Types

type Commit

type Commit struct {
	// CommitID is a long lasting id describing the commit.
	//  The CommitID is generated and added to the end of the commit message on the initial commit.
	//  The CommitID remains the same when a commit is amended.
	CommitID string

	// CommitHash is the git commit hash, this gets updated everytime the commit is amended.
	CommitHash string

	// Subject is the subject of the commit message.
	Subject string

	// Body is the body of the commit message.
	Body string

	// WIP is true if the commit is still work in progress.
	WIP bool
}

Commit has all the git commit info

func GetLocalCommitStack added in v0.12.1

func GetLocalCommitStack(cfg *config.Config, gitcmd GitInterface) []Commit

GetLocalCommitStack returns a list of unmerged commits

the list is ordered with the bottom commit in the stack first

func GetLocalTopCommit added in v0.12.1

func GetLocalTopCommit(cfg *config.Config, gitcmd GitInterface) *Commit

GetLocalTopCommit returns the top unmerged commit in the stack

return nil if there are no unmerged commits in the stack

type GitInterface

type GitInterface interface {
	GitWithEditor(args string, output *string, editorCmd string) error
	Git(args string, output *string) error
	MustGit(args string, output *string)
	RootDir() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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