Smart Merge Engine
When multiple machines push changes, Git may produce merge conflicts. DaemonHound understands file content — not just raw text.
How it works
- Engine identifies the file type
- Selects the appropriate merge driver
- Performs a 3-way merge (base | local | remote)
- If a true conflict remains (same key changed), flags for manual resolution
Merge drivers
| Driver | File types | Strategy |
|---|---|---|
| EnvDriver | .env, .env.local | Key-value aware. Both sides modify same key = true conflict. |
| JSONDriver | .json | Structural merge at property level. |
| CSVDriver | .csv | Row-level merge. |
| SecretDriver | Secret TOML | Version-aware. Latest version wins. |
| StateDriver | state.toml.age | Vault state merge (highest priority). |
| TextDriver | Plaintext | Line-based fallback. |
Example: .env merge
Machine A adds STRIPE_KEY, Machine B rotates API_KEY:
Merge
# Machine A added STRIPE_KEY
DATABASE_URL=postgres://localhost/mydb
REDIS_URL=redis://localhost:6379
API_KEY=sk-old
STRIPE_KEY=pk_test_a
# Machine B rotated API_KEY
DATABASE_URL=postgres://localhost/mydb
REDIS_URL=redis://localhost:6379
API_KEY=sk-new
# Smart merged result:
DATABASE_URL=postgres://localhost/mydb
REDIS_URL=redis://localhost:6379
API_KEY=sk-new
STRIPE_KEY=pk_test_aBoth changes apply cleanly — different keys. No manual intervention needed.
Resolving conflicts
CLI
Shell
dhd conflicts list
dhd conflicts show .env.local
dhd conflicts resolve .env.local --strategy local
dhd conflicts resolve .env.local --strategy remote
dhd conflicts clearWeb UI
Run dhd ui — 3-way diff view with side-by-side comparison.
Interactive TUI
Shell
dhd merge resolveGit integration
Shell
dhd git setup # Configure merge drivers, diff, filters
dhd git hook # Install pre-commit, post-merge hooks