git

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckGitRepository

func CheckGitRepository() bool

func CommitChanges

func CommitChanges(commitMessage string) error

func FilterLockFiles

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

func GetCurrentBranch

func GetCurrentBranch() (string, error)

func GetGitDiff

func GetGitDiff() (string, error)

func GetHeadCommitMessage added in v0.1.0

func GetHeadCommitMessage() (string, error)

GetHeadCommitMessage retrieves the HEAD commit message

Types

type DiffChunk added in v0.1.0

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

DiffChunk represents one contiguous set of changed lines in the diff

func ParseDiffToChunks added in v0.1.0

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

ParseDiffToChunks processes a unified diff string into a list of DiffChunks. This is a naive parser that assumes the diff is in "git diff --staged" format.

Jump to

Keyboard shortcuts

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