Documentation
¶
Index ¶
- func GenerateID(commitSHA string, ts time.Time) string
- type Snapshot
- type SnapshotStore
- func (s *SnapshotStore) AddSnapshot(snapshot Snapshot) error
- func (s *SnapshotStore) DeleteSnapshot(repoRoot, id string) error
- func (s *SnapshotStore) GetSnapshot(identifier, repoRoot string) (*Snapshot, error)
- func (s *SnapshotStore) GetSnapshotByCommit(repoRoot, commit string) (*Snapshot, error)
- func (s *SnapshotStore) ListSnapshots(repoRoot string) ([]Snapshot, error)
- func (s *SnapshotStore) LoadSnapshots() ([]Snapshot, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Snapshot ¶
type Snapshot struct {
ID string `json:"id"` // Unique identifier
CommitSHA string `json:"commit_sha"` // Ghost commit SHA
ParentSHA string `json:"parent_sha"` // Parent commit SHA (HEAD at snapshot time)
Message string `json:"message"` // Snapshot message
Timestamp time.Time `json:"timestamp"` // When snapshot was created
RepoRoot string `json:"repo_root"` // Repository root path
PreexistingUntrackedFiles []string `json:"preexisting_untracked_files"` // Untracked files before snapshot
PreexistingUntrackedDirs []string `json:"preexisting_untracked_dirs"` // Untracked dirs before snapshot
}
Snapshot represents a stored ghost commit
type SnapshotStore ¶
type SnapshotStore struct {
StorageDir string
// contains filtered or unexported fields
}
SnapshotStore manages snapshot persistence
func NewSnapshotStore ¶
func NewSnapshotStore() (*SnapshotStore, error)
NewSnapshotStore creates a new snapshot store
func (*SnapshotStore) AddSnapshot ¶
func (s *SnapshotStore) AddSnapshot(snapshot Snapshot) error
AddSnapshot adds a new snapshot scoped to its repository
func (*SnapshotStore) DeleteSnapshot ¶
func (s *SnapshotStore) DeleteSnapshot(repoRoot, id string) error
DeleteSnapshot removes a snapshot by ID within the repo
func (*SnapshotStore) GetSnapshot ¶
func (s *SnapshotStore) GetSnapshot(identifier, repoRoot string) (*Snapshot, error)
GetSnapshot retrieves a snapshot by ID or repo-scoped index (1-based for user convenience)
func (*SnapshotStore) GetSnapshotByCommit ¶
func (s *SnapshotStore) GetSnapshotByCommit(repoRoot, commit string) (*Snapshot, error)
GetSnapshotByCommit finds a snapshot for the repo by commit SHA (prefix allowed).
func (*SnapshotStore) ListSnapshots ¶
func (s *SnapshotStore) ListSnapshots(repoRoot string) ([]Snapshot, error)
ListSnapshots returns all snapshots for a specific repository
func (*SnapshotStore) LoadSnapshots ¶
func (s *SnapshotStore) LoadSnapshots() ([]Snapshot, error)
LoadSnapshots loads all snapshots from all repositories
Click to show internal directories.
Click to hide internal directories.