git

package
v0.5.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

func CommitChanges

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

CommitChanges creates a commit with the provided message.

func FilterLockFiles

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

func GetCurrentBranch

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

func GetGitDiff

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

func GetHeadCommitMessage added in v0.1.0

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

func IsGitRepository added in v0.3.0

func IsGitRepository(ctx context.Context) bool

func PrependCommitType added in v0.3.0

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

PrependCommitType checks if we want to add an emoji (based on config) and/or commitType: e.g., "fix: some text" or "🐛 fix: some text".

Types

type DiffChunk added in v0.1.0

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

DiffChunk represents a section of a Git diff.

func ParseDiffToChunks added in v0.1.0

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

ParseDiffToChunks splits a diff string into chunks.

Jump to

Keyboard shortcuts

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