git

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchNameFromCommit added in v0.12.1

func BranchNameFromCommit(commit Commit) string

func GetLocalBranchName added in v0.12.1

func GetLocalBranchName(gitcmd GitInterface) string

GetLocalBranchName returns the current local git branch

func GetRemoteBranchName added in v0.12.1

func GetRemoteBranchName(repoConfig *config.RepoConfig, gitcmd GitInterface) string

GetRemoteBranchName

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(repoConfig *config.RepoConfig, 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(repoConfig *config.RepoConfig, 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