git

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotGitRepo = errors.New("not a git repository")

Functions

func CommitsSince

func CommitsSince(repo *git.Repository, sinceHash string) ([]*object.Commit, error)

CommitsSince returns all commits after (not including) the given hash. It walks from HEAD backwards and stops when it reaches the given hash.

func GetHEADSHA

func GetHEADSHA(repo *git.Repository) (string, error)

func ListFiles added in v0.0.5

func ListFiles(repo *git.Repository) ([]string, error)

func OpenGitRepo

func OpenGitRepo(path string) (*git.Repository, error)

func PatchAddsDeletes

func PatchAddsDeletes(patch *object.Patch) (added int64, deleted int64)

func PatchSince

func PatchSince(repo *git.Repository, sinceHash string) (*object.Patch, error)

func UnstagedChangeCount

func UnstagedChangeCount(repo *git.Repository) (int64, error)

UnstagedChangeCount returns the count of tracked files with unstaged changes. It counts files with Modified, Deleted, or Renamed status in the worktree. Untracked files are ignored.

Types

type Event added in v0.0.5

type Event struct {
	Type EventType
}

type EventType added in v0.0.5

type EventType string
const (
	EventTypeUnknown   EventType = "unknown"
	EventTypeNewCommit EventType = "new commit"
)

type Monitor added in v0.0.5

type Monitor struct {
	FileEvents chan files.Event
	GitEvents  chan Event
	// contains filtered or unexported fields
}

func NewMonitor added in v0.0.5

func NewMonitor(opts *MonitorOpts) (*Monitor, error)

func (*Monitor) Close added in v0.0.5

func (m *Monitor) Close()

func (*Monitor) Run added in v0.0.5

func (m *Monitor) Run(ctx context.Context)

func (*Monitor) Stats added in v0.0.5

func (m *Monitor) Stats(final bool) *Stats

func (*Monitor) Update added in v0.0.5

func (m *Monitor) Update(ctx context.Context)

type MonitorOpts added in v0.0.5

type MonitorOpts struct {
	RootPath string
}

func (*MonitorOpts) OK added in v0.0.5

func (m *MonitorOpts) OK() error

type Stats added in v0.0.5

type Stats struct {
	NumCommits      int64
	LinesAdded      int64
	LinesDeleted    int64
	UnstagedChanges int64

	Commits []*object.Commit
	Patch   *object.Patch
}

Jump to

Keyboard shortcuts

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