/{cmd,docs,internal}: support import export for dolt backends

This commit is contained in:
Test
2026-01-21 13:13:24 -08:00
parent 4a0f4abc70
commit b849f598d7
23 changed files with 1837 additions and 226 deletions

View File

@@ -510,7 +510,7 @@ func CheckDatabaseIntegrity(path string) DoctorCheck {
func CheckDatabaseJSONLSync(path string) DoctorCheck {
backend, beadsDir := getBackendAndBeadsDir(path)
// Dolt backend: JSONL is a derived compatibility artifact (export-only today).
// Dolt backend: JSONL is an optional compatibility artifact.
// The SQLite-style import/export divergence checks don't apply.
if backend == configfile.BackendDolt {
// Find JSONL file (respects metadata.json override when set).
@@ -545,7 +545,7 @@ func CheckDatabaseJSONLSync(path string) DoctorCheck {
Name: "DB-JSONL Sync",
Status: StatusOK,
Message: "N/A (dolt backend)",
Detail: "JSONL is derived from Dolt (export-only); import-only sync checks do not apply",
Detail: "Dolt sync is database-native; JSONL divergence checks do not apply (manual JSONL import/export is supported).",
}
}

View File

@@ -780,14 +780,20 @@ func TestMergeDriverWithLockedConfig_E2E(t *testing.T) {
dir := setupTestGitRepo(t)
gitDir := filepath.Join(dir, ".git")
gitConfigPath := filepath.Join(dir, ".git", "config")
// Make git config read-only
if err := os.Chmod(gitConfigPath, 0444); err != nil {
// Make both .git directory and config file read-only to truly prevent writes.
// Git may otherwise write via lockfile+rename even if the config file itself is read-only.
if err := os.Chmod(gitConfigPath, 0400); err != nil {
t.Fatalf("failed to make config read-only: %v", err)
}
if err := os.Chmod(gitDir, 0500); err != nil {
t.Fatalf("failed to make .git read-only: %v", err)
}
defer func() {
// Restore permissions for cleanup
_ = os.Chmod(gitDir, 0755)
_ = os.Chmod(gitConfigPath, 0644)
}()

View File

@@ -68,7 +68,7 @@ func CheckSyncDivergence(path string) DoctorCheck {
}
// Check 2: SQLite last_import_time vs JSONL mtime (SQLite only).
// Dolt backend does not maintain SQLite metadata and does not support import-only sync.
// Dolt backend does not maintain SQLite metadata; this SQLite-only check doesn't apply.
if backend == configfile.BackendSQLite {
mtimeIssue := checkSQLiteMtimeDivergence(path, beadsDir)
if mtimeIssue != nil {