feat(dolt): auto-commit write commands and set explicit commit authors (#1270)

Adds Dolt auto-commit functionality for write commands and sets explicit commit authors.

Includes fix for race condition in commandDidWrite (converted to atomic.Bool).

Original PR: #1267 by @coffeegoddd
Co-authored-by: Dustin Brown <dustin@dolthub.com>
This commit is contained in:
Steve Yegge
2026-01-22 20:52:20 -08:00
committed by John Ogle
parent 9fd0ea2c67
commit 0ee020ed76
18 changed files with 596 additions and 45 deletions

View File

@@ -680,6 +680,8 @@ func hookPostMergeDolt(beadsDir string) int {
}
// Commit changes on import branch
// This hook flow commits to Dolt explicitly; avoid redundant auto-commit in PersistentPostRun.
commandDidExplicitDoltCommit = true
if err := doltStore.Commit(ctx, "Import from JSONL"); err != nil {
fmt.Fprintf(os.Stderr, "Warning: could not commit import: %v\n", err)
}
@@ -702,6 +704,8 @@ func hookPostMergeDolt(beadsDir string) int {
}
// Commit the merge
// Still part of explicit hook commit flow.
commandDidExplicitDoltCommit = true
if err := doltStore.Commit(ctx, "Merge JSONL import"); err != nil {
// May fail if nothing to commit (fast-forward merge)
// This is expected, not an error