Add locked files and directory-only entries.
Locked files (--lock): repo-authoritative entries. Checkpoint skips them (preserves repo version). Status reports "drifted" instead of "modified". Restore always overwrites if hash differs, no prompt. Use case: system-managed files the OS overwrites. Directory-only entries (--dir): track directory itself without recursing. Restore ensures directory exists with correct permissions. Use case: directories that must exist but contents are managed elsewhere. Add refactored to use AddOptions struct (Encrypt, Lock, DirOnly) instead of variadic bools. Proto: ManifestEntry gains locked field. convert.go updated. 7 new tests. ARCHITECTURE.md and README.md updated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,8 @@ sgard restore --repo /mnt/usb/dotfiles
|
||||
|---|---|
|
||||
| `init` | Create a new repository |
|
||||
| `add <path>...` | Track files, directories (recursed), or symlinks |
|
||||
| `add --lock <path>...` | Track as locked (repo-authoritative, auto-restores on drift) |
|
||||
| `add --dir <path>` | Track directory itself without recursing into contents |
|
||||
| `remove <path>...` | Stop tracking files |
|
||||
| `checkpoint [-m msg]` | Re-hash tracked files and update the manifest |
|
||||
| `restore [path...] [-f]` | Restore files to their original locations |
|
||||
|
||||
Reference in New Issue
Block a user