git

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGitmoji added in v0.3.0

func AddGitmoji(message, commitType string) string

AddGitmoji checks if there's a known emoji for the type.

func CommitChanges

func CommitChanges(ctx context.Context, commitMessage string) error

CommitChanges creates a commit with the specified message.

func FilterLockFiles

func FilterLockFiles(diff string, lockFiles []string) string

FilterLockFiles removes any lockfiles from the diff (like go.sum, yarn.lock, etc.).

func GetCurrentBranch

func GetCurrentBranch(ctx context.Context) (string, error)

GetCurrentBranch returns the currently checked-out branch name.

func GetGitDiffIgnoringMoves added in v0.6.0

func GetGitDiffIgnoringMoves(ctx context.Context) (string, error)

GetGitDiffIgnoringMoves is like the old GetGitDiff but also

func GetHeadCommitMessage added in v0.1.0

func GetHeadCommitMessage(ctx context.Context) (string, error)

GetHeadCommitMessage returns HEAD commit message text.

func IsGitRepository added in v0.3.0

func IsGitRepository(ctx context.Context) bool

IsGitRepository checks if we're in a valid git repo.

func PrependCommitType added in v0.3.0

func PrependCommitType(message, commitType string, withEmoji bool) string

PrependCommitType prepends "type: " (and possibly an emoji) to the commit message.

Types

type DiffChunk added in v0.1.0

type DiffChunk struct {
	FilePath   string
	HunkHeader string
	Lines      []string
}

DiffChunk + ParseDiffToChunks remain the same for interactive-split usage:

func ParseDiffToChunks added in v0.1.0

func ParseDiffToChunks(diff string) ([]DiffChunk, error)

Jump to

Keyboard shortcuts

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