Skip to main content

attach_subbrain

Function attach_subbrain 

Source
pub fn attach_subbrain(
    workspace: &Path,
    id: &str,
    root: &str,
    aliases: &[String],
) -> Result<WorkspaceManifest>
Expand description

Attach an existing directory under the workspace as a SubBrain without copying.

Umbrella pattern: three former mono-repos under one folder become SubBrains of a new MainBrain:

umbrella/           ← rustbrain scopes enable --empty
  .brain/           ← new MainBrain
  project-a/        ← scopes attach project-a --root project-a
  project-b/
  project-c/

Nested project-a/.brain may still exist for working inside that tree alone (Brain::open finds the nearest .brain). The umbrella indexes path ownership.