Documentation
¶
Overview ¶
Package reconcile compares and copies project and central trees.
Index ¶
- Constants
- func CopyTree(source, destination string) error
- func InspectTree(root string) (Snapshot, []Issue, error)
- func SortIssues(issues []Issue)
- func StageSnapshot(destinationRoot string, snapshot Snapshot) (string, error)
- func TreesEqual(left, right string) (bool, error)
- type Change
- type ConflictKind
- type Entry
- type EntryKind
- type FileResult
- type Issue
- type IssueKind
- type MergeConflict
- type MergeResult
- type Result
- type Snapshot
- type SyncState
- type TreeReplacement
Constants ¶
const ( StagePathPrefix = ".lore-stage-" BackupPathPrefix = ".lore-backup-" )
Variables ¶
This section is empty.
Functions ¶
func InspectTree ¶
InspectTree snapshots a real directory without following symlinks.
func SortIssues ¶
func SortIssues(issues []Issue)
SortIssues orders issues by path then kind so output stays stable.
func StageSnapshot ¶
StageSnapshot creates a sibling tree containing a merged snapshot.
func TreesEqual ¶
TreesEqual reports whether two trees contain the same Git-reproducible data.
Types ¶
type ConflictKind ¶
type ConflictKind string
ConflictKind identifies the unresolved representation written by pull.
const ( ConflictText ConflictKind = "text" ConflictKeepBoth ConflictKind = "keep-both" ConflictSiblingSuffix = ".sync-conflict" )
type EntryKind ¶
type EntryKind string
EntryKind identifies Git-reproducible filesystem object types.
type FileResult ¶
type FileResult struct {
Path string
State SyncState
ProjectChange Change
CentralChange Change
Project *Entry
Central *Entry
Base *Entry
}
FileResult is the three-way verdict for one path.
type IssueKind ¶
type IssueKind string
IssueKind identifies a condition outside the four sync states.
const ( IssueCopyMissing IssueKind = "copy-missing" IssueCopyInvalid IssueKind = "copy-invalid" IssueUnsupportedObject IssueKind = "unsupported-object" IssueConflictMarkers IssueKind = "conflict-markers" IssueConflictSibling IssueKind = "conflict-sibling" IssueCentralDirty IssueKind = "central-dirty" IssueBaseUnreachable IssueKind = "base-unreachable" IssueCentralMissing IssueKind = "central-missing" IssueInspectionFailed IssueKind = "inspection-failed" )
type MergeConflict ¶
type MergeConflict struct {
Path string
Kind ConflictKind
SiblingPath string
}
MergeConflict describes one unresolved path and its optional sibling.
type MergeResult ¶
type MergeResult struct {
Snapshot Snapshot
Conflicts []MergeConflict
}
MergeResult contains the project-side tree produced by reconciliation.
func MergeFiles ¶
func MergeFiles(files []FileResult) (MergeResult, error)
MergeFiles reconciles an existing three-way file classification.
func MergeSnapshots ¶
func MergeSnapshots(project, central, base Snapshot) (MergeResult, error)
MergeSnapshots reconciles project and central snapshots against base.
type Result ¶
type Result struct {
State SyncState
BaseStale bool
Files []FileResult
Issues []Issue
}
Result is the read-only classification of one agent directory.
type TreeReplacement ¶
TreeReplacement names one central-to-project tree publication.