Documentation
¶
Index ¶
- func AddGitmoji(message, commitType string) string
- func CommitChanges(ctx context.Context, commitMessage string) error
- func FilterLockFiles(diff string, lockFiles []string) string
- func GetCurrentBranch(ctx context.Context) (string, error)
- func GetGitDiffIgnoringMoves(ctx context.Context) (string, error)
- func GetHeadCommitMessage(ctx context.Context) (string, error)
- func IsGitRepository(ctx context.Context) bool
- func PrependCommitType(message, commitType string, withEmoji bool) string
- type DiffChunk
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGitmoji ¶ added in v0.3.0
AddGitmoji adds emoji if configured, or just ensures a clean type prefix.
func CommitChanges ¶
CommitChanges creates a commit with a supplied message and the configured author identity.
func FilterLockFiles ¶
FilterLockFiles drops entire file sections that match any of the provided lock file names.
func GetCurrentBranch ¶
GetCurrentBranch returns the short name of the current branch.
func GetGitDiffIgnoringMoves ¶ added in v0.6.0
GetGitDiffIgnoringMoves builds a textual diff based on HEAD vs current working tree, focused on staged changes (status.Staging != Unmodified). It removes moves and attempts to drop pure comment-only changes to produce a cleaner prompt for LLMs.
NOTE: New content is read from the working tree, not the index. This is a known limitation if the user stages partial changes and then edits further. To make it *exactly* reflect the index, you’d need to read blobs from the index (or shell-out to `git show :path`).
func GetHeadCommitMessage ¶ added in v0.1.0
GetHeadCommitMessage returns the HEAD commit message.
func IsGitRepository ¶ added in v0.3.0
IsGitRepository returns true if "." is a Git repo.
func PrependCommitType ¶ added in v0.3.0
PrependCommitType ensures there's a single prefix (optionally with gitmoji) and prepends it.
Types ¶
type DiffChunk ¶ added in v0.1.0
DiffChunk represents a parsed @@ hunk from a diff.
func ParseDiffToChunks ¶ added in v0.1.0
ParseDiffToChunks splits our diff into per-file hunk chunks used by the interactive splitter.