git

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffTargets

func DiffTargets(args []string) (base, target string, err error)

func StatusChar

func StatusChar(status string) string

Types

type BranchInfo

type BranchInfo struct {
	Name    string `json:"name"`
	Current bool   `json:"current"`
	Remote  string `json:"remote"`
	Date    string `json:"date"`
	Message string `json:"message"`
}

type ChangedFile

type ChangedFile struct {
	Path   string `json:"path"`
	Status string `json:"status"`
}

func FilterByPaths

func FilterByPaths(files []ChangedFile, paths []string) []ChangedFile

type CommitInfo

type CommitInfo struct {
	Hash    string `json:"hash"`
	Author  string `json:"author"`
	Date    string `json:"date"`
	Message string `json:"message"`
	Body    string `json:"body,omitempty"`
}

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

func OpenRepo

func OpenRepo() (*Repo, error)

func (*Repo) ChangedFiles

func (r *Repo) ChangedFiles(staged bool) ([]ChangedFile, error)

func (*Repo) DiffBetweenCommits

func (r *Repo) DiffBetweenCommits(baseRef, targetRef string) ([]ChangedFile, error)

func (*Repo) ListBranches

func (r *Repo) ListBranches() ([]BranchInfo, error)

func (*Repo) ListStashes

func (r *Repo) ListStashes() ([]StashEntry, error)

func (*Repo) Log

func (r *Repo) Log(ref string, maxCount int, paths []string) ([]CommitInfo, error)

func (*Repo) LogAll

func (r *Repo) LogAll(maxCount int, paths []string) ([]CommitInfo, error)

func (*Repo) Root

func (r *Repo) Root() string

func (*Repo) Stage

func (r *Repo) Stage(paths ...string) error

func (*Repo) StageHunk

func (r *Repo) StageHunk(patch string) error

func (*Repo) StatusFiles

func (r *Repo) StatusFiles() ([]StatusFile, error)

func (*Repo) Unstage

func (r *Repo) Unstage(paths ...string) error

func (*Repo) UnstageHunk

func (r *Repo) UnstageHunk(patch string) error

type StashEntry

type StashEntry struct {
	Index   int    `json:"index"`
	Branch  string `json:"branch"`
	Message string `json:"message"`
	Date    string `json:"date"`
}

type StatusFile

type StatusFile struct {
	Path           string `json:"path"`
	StagingStatus  string `json:"staging_status"`
	WorktreeStatus string `json:"worktree_status"`
}

Jump to

Keyboard shortcuts

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