gitcp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package gitcp takes git snapshots of a working tree before each agent turn, so changes can be shown (/diff) and rolled back (/undo) without touching the user's branch, index or stash.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(ctx context.Context, dir, from string) (string, error)

Diff returns a patch from `from` (a commit, or "HEAD") to the current working tree, including new untracked files.

func Restore

func Restore(ctx context.Context, dir, commit string) error

Restore puts the working tree back to the snapshot: changed and deleted files are restored, files created since are removed. The index and branch are left alone.

func Root

func Root(ctx context.Context, dir string) string

Root returns the repository root containing dir, or "" if dir is not in a repo.

func Snapshot

func Snapshot(ctx context.Context, dir string) (string, error)

Snapshot records the current working tree and returns a commit id.

Types

This section is empty.

Jump to

Keyboard shortcuts

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