Update documentation for merge driver auto-configuration
- Add merge driver to bd init workflow in README.md - Update AGENTS.md with auto-config details - Document --skip-merge-driver flag - Provide manual setup instructions - Clarify beads-merge as alternative external tool Completes bd-ggbc
This commit is contained in:
38
AGENTS.md
38
AGENTS.md
@@ -12,8 +12,9 @@ This is **beads** (command: `bd`), an issue tracker designed for AI-supervised c
|
|||||||
bd init --quiet # Non-interactive, auto-installs git hooks, no prompts
|
bd init --quiet # Non-interactive, auto-installs git hooks, no prompts
|
||||||
```
|
```
|
||||||
|
|
||||||
**Why `--quiet`?** Regular `bd init` has interactive prompts (git hooks) that confuse agents. The `--quiet` flag makes it fully non-interactive:
|
**Why `--quiet`?** Regular `bd init` has interactive prompts (git hooks, merge driver) that confuse agents. The `--quiet` flag makes it fully non-interactive:
|
||||||
- Automatically installs git hooks
|
- Automatically installs git hooks
|
||||||
|
- Automatically configures git merge driver for intelligent JSONL merging
|
||||||
- No prompts for user input
|
- No prompts for user input
|
||||||
- Safe for agent-driven repo setup
|
- Safe for agent-driven repo setup
|
||||||
|
|
||||||
@@ -775,17 +776,35 @@ git commit
|
|||||||
|
|
||||||
**Note:** `bd import` automatically handles updates - same ID with different content is a normal update operation. No special flags needed. If you accidentally modified the same issue in both branches, just pick whichever version is more complete.
|
**Note:** `bd import` automatically handles updates - same ID with different content is a normal update operation. No special flags needed. If you accidentally modified the same issue in both branches, just pick whichever version is more complete.
|
||||||
|
|
||||||
### Advanced: Intelligent Merge Tools
|
### Intelligent Merge Driver (Auto-Configured)
|
||||||
|
|
||||||
For Git merge conflicts in `.beads/issues.jsonl`, use **[beads-merge](https://github.com/neongreen/mono/tree/main/beads-merge)** - a production-ready 3-way merge tool by @neongreen that:
|
**As of v0.21+, bd automatically configures its own merge driver during `bd init`.** This provides intelligent JSONL merging to prevent conflicts when multiple branches modify issues.
|
||||||
|
|
||||||
- **Prevents conflicts proactively** with field-level merging
|
**What it does:**
|
||||||
|
- Performs field-level 3-way merging (not line-by-line)
|
||||||
- Matches issues by identity (id + created_at + created_by)
|
- Matches issues by identity (id + created_at + created_by)
|
||||||
- Smart field merging: timestamps→max, dependencies→union, status/priority→3-way
|
- Smart field merging: timestamps→max, dependencies→union, status/priority→3-way
|
||||||
- Outputs conflict markers only for unresolvable conflicts
|
- Outputs conflict markers only for unresolvable conflicts
|
||||||
- Works as Git/jujutsu merge driver (opt-in)
|
- Automatically configured during `bd init` (both interactive and `--quiet` modes)
|
||||||
|
|
||||||
**Setup (one-time)**:
|
**Auto-configuration (happens automatically):**
|
||||||
|
```bash
|
||||||
|
# During bd init, these are configured:
|
||||||
|
git config merge.beads.driver "bd merge %A %O %L %R"
|
||||||
|
git config merge.beads.name "bd JSONL merge driver"
|
||||||
|
# .gitattributes entry: .beads/beads.jsonl merge=beads
|
||||||
|
```
|
||||||
|
|
||||||
|
**Manual setup (if skipped with `--skip-merge-driver`):**
|
||||||
|
```bash
|
||||||
|
git config merge.beads.driver "bd merge %A %O %L %R"
|
||||||
|
git config merge.beads.name "bd JSONL merge driver"
|
||||||
|
echo ".beads/beads.jsonl merge=beads" >> .gitattributes
|
||||||
|
```
|
||||||
|
|
||||||
|
**Alternative: External beads-merge tool**
|
||||||
|
|
||||||
|
For advanced users, **[beads-merge](https://github.com/neongreen/mono/tree/main/beads-merge)** by @neongreen is a standalone 3-way merge tool that can be used instead of `bd merge`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install (requires Go 1.21+)
|
# Install (requires Go 1.21+)
|
||||||
@@ -793,14 +812,9 @@ git clone https://github.com/neongreen/mono.git
|
|||||||
cd mono/beads-merge
|
cd mono/beads-merge
|
||||||
go install
|
go install
|
||||||
|
|
||||||
# Configure Git merge driver
|
# Configure Git merge driver (replaces bd merge)
|
||||||
git config merge.beads.name "JSONL merge driver for beads"
|
git config merge.beads.name "JSONL merge driver for beads"
|
||||||
git config merge.beads.driver "beads-merge %A %O %A %B"
|
git config merge.beads.driver "beads-merge %A %O %A %B"
|
||||||
|
|
||||||
# Enable for beads JSONL files (in your repo)
|
|
||||||
echo ".beads/beads.jsonl merge=beads" >> .gitattributes
|
|
||||||
git add .gitattributes
|
|
||||||
git commit -m "Enable beads-merge for JSONL files"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**For Jujutsu users**, add to `~/.jjconfig.toml`:
|
**For Jujutsu users**, add to `~/.jjconfig.toml`:
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ The wizard will:
|
|||||||
- Create `.beads/` directory and database
|
- Create `.beads/` directory and database
|
||||||
- Import existing issues from git (if any)
|
- Import existing issues from git (if any)
|
||||||
- Prompt to install git hooks (recommended)
|
- Prompt to install git hooks (recommended)
|
||||||
|
- Prompt to configure git merge driver (recommended)
|
||||||
- Auto-start daemon for sync
|
- Auto-start daemon for sync
|
||||||
|
|
||||||
## Your First Issues
|
## Your First Issues
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -115,6 +115,7 @@ bd init --branch beads-metadata
|
|||||||
# - Create .beads/ directory with database
|
# - Create .beads/ directory with database
|
||||||
# - Import existing issues from git (if any)
|
# - Import existing issues from git (if any)
|
||||||
# - Prompt to install git hooks (recommended: say yes)
|
# - Prompt to install git hooks (recommended: say yes)
|
||||||
|
# - Prompt to configure git merge driver (recommended: say yes)
|
||||||
# - Auto-start daemon for sync
|
# - Auto-start daemon for sync
|
||||||
|
|
||||||
# Then tell your agent about bd:
|
# Then tell your agent about bd:
|
||||||
@@ -129,10 +130,17 @@ echo "BEFORE ANYTHING ELSE: run 'bd onboard' and follow the instructions" >> AGE
|
|||||||
3. Update CLAUDE.md with a note (if present)
|
3. Update CLAUDE.md with a note (if present)
|
||||||
4. Remove the bootstrap instruction
|
4. Remove the bootstrap instruction
|
||||||
|
|
||||||
**For agents setting up repos:** Use `bd init --quiet` for non-interactive setup (auto-installs git hooks, no prompts).
|
**For agents setting up repos:** Use `bd init --quiet` for non-interactive setup (auto-installs git hooks and merge driver, no prompts).
|
||||||
|
|
||||||
**For new repo clones:** Run `bd init` (or `bd init --quiet` for agents) to import existing issues from `.beads/issues.jsonl` automatically.
|
**For new repo clones:** Run `bd init` (or `bd init --quiet` for agents) to import existing issues from `.beads/issues.jsonl` automatically.
|
||||||
|
|
||||||
|
**Git merge driver:** During `bd init`, beads configures git to use `bd merge` for intelligent JSONL merging. This prevents conflicts when multiple branches modify issues. Skip with `--skip-merge-driver` if needed. To configure manually later:
|
||||||
|
```bash
|
||||||
|
git config merge.beads.driver "bd merge %A %O %L %R"
|
||||||
|
git config merge.beads.name "bd JSONL merge driver"
|
||||||
|
echo ".beads/beads.jsonl merge=beads" >> .gitattributes
|
||||||
|
```
|
||||||
|
|
||||||
**Using devcontainers?** Open the repository in a devcontainer (GitHub Codespaces or VS Code Remote Containers) and bd will be automatically installed with git hooks configured. See [.devcontainer/README.md](.devcontainer/README.md) for details.
|
**Using devcontainers?** Open the repository in a devcontainer (GitHub Codespaces or VS Code Remote Containers) and bd will be automatically installed with git hooks configured. See [.devcontainer/README.md](.devcontainer/README.md) for details.
|
||||||
|
|
||||||
Most tasks will be created and managed by agents during conversations. You can check on things with:
|
Most tasks will be created and managed by agents during conversations. You can check on things with:
|
||||||
|
|||||||
Reference in New Issue
Block a user