Skip to content

feat: auto-detect beads database on git origin during init/bootstrap#2585

Merged
steveyegge merged 2 commits into
gastownhall:mainfrom
cwalv:fix/init-auto-detect-dolt-ref
Mar 15, 2026
Merged

feat: auto-detect beads database on git origin during init/bootstrap#2585
steveyegge merged 2 commits into
gastownhall:mainfrom
cwalv:fix/init-auto-detect-dolt-ref

Conversation

@cwalv

@cwalv cwalv commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bd init and bd bootstrap now probe origin for refs/dolt/data before creating a fresh database
  • If the ref exists, the existing beads database is cloned automatically — no config needed
  • Eliminates the "no common ancestor" error when running bd dolt pull in fresh clones

Fixes #2580

Test plan

  • TestDetectBootstrapAction_SyncWhenOriginHasDoltRef — verifies bootstrap detects the ref
  • TestDetectBootstrapAction_InitWhenOriginHasNoDoltRef — verifies fallback to fresh init
  • TestGitURLToDoltRemote — verifies URL conversion for HTTPS, SSH, SCP-style
  • TestGitRemoteGetURL / TestGitLsRemoteHasRef / TestIsBareGitRepo — git helper tests
  • Existing bootstrap tests updated to isolate from parent git repo

@codecov-commenter

Copy link
Copy Markdown

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
4713 3 4710 533
View the top 3 failed test(s) by shortest run time
github.com/steveyegge/beads/cmd/bd::TestDetectBootstrapAction_SyncWhenOriginHasDoltRef
Stack Traces | 0.01s run time
=== RUN   TestDetectBootstrapAction_SyncWhenOriginHasDoltRef
    bootstrap_test.go:113: git [commit --allow-empty -m init] failed: exit status 128
        Author identity unknown
        
        *** Please tell me who you are.
        
        Run
        
          git config --global user.email "you@example.com"
          git config --global user.name "Your Name"
        
        to set your account's default identity.
        Omit --global to set the identity only in this repository.
        
        fatal: empty ident name (for <runner@runnervm0kj6c.bnlheokxlokujiv1ylew4udf0c.gx.internal.cloudapp.net>) not allowed
--- FAIL: TestDetectBootstrapAction_SyncWhenOriginHasDoltRef (0.01s)
github.com/steveyegge/beads/cmd/bd::TestGitLsRemoteHasRef/returns_true_for_existing_ref
Stack Traces | 0.02s run time
=== RUN   TestGitLsRemoteHasRef/returns_true_for_existing_ref
    sync_git_test.go:141: git [commit --allow-empty -m init] failed: exit status 128
        Author identity unknown
        
        *** Please tell me who you are.
        
        Run
        
          git config --global user.email "you@example.com"
          git config --global user.name "Your Name"
        
        to set your account's default identity.
        Omit --global to set the identity only in this repository.
        
        fatal: empty ident name (for <runner@runnervm0kj6c.bnlheokxlokujiv1ylew4udf0c.gx.internal.cloudapp.net>) not allowed
--- FAIL: TestGitLsRemoteHasRef/returns_true_for_existing_ref (0.02s)
github.com/steveyegge/beads/cmd/bd::TestGitLsRemoteHasRef
Stack Traces | 0.04s run time
=== RUN   TestGitLsRemoteHasRef
--- FAIL: TestGitLsRemoteHasRef (0.04s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

When running `bd bootstrap` in a fresh clone, probe origin for
refs/dolt/data and automatically clone the existing beads database
instead of creating unrelated state. `bd init` warns if the ref
exists and suggests using `bd bootstrap` instead.

Fixes gastownhall#2580
@cwalv cwalv force-pushed the fix/init-auto-detect-dolt-ref branch from 1d3bc5c to 4d14fb8 Compare March 14, 2026 07:18

@ktoulgaridis ktoulgaridis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All checks pass except Embedded Dolt (systemic failure across all PRs and main). Nice feature — auto-detects beads database on origin via refs/dolt/data during init/bootstrap. Thorough test coverage with bare repo setups. LGTM.

@steveyegge steveyegge merged commit ef59bd0 into gastownhall:main Mar 15, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bd init in a fresh second git clone creates unrelated local Beads state, and bd dolt pull fails with no common ancestor in v0.60.0

4 participants