2026-03 mar - add mg layout aware worktrees#
2026-03-28 - Saturday#
Added layout-aware worktree path resolution in mg so branch creation and switching follow repository structure automatically.
Change summary#
Added layout detection in
git-lib.shfordefault,parent-bare-siblings,bare-siblings.git, andbare-siblings.Added centralized worktree path resolution helpers that preserve repo-root default branch behavior in
defaultlayout and route new branches under<repo>-worktrees.Updated bare sibling handling to place new worktrees as siblings of the default branch worktree parent, including cases where that parent is the bare repo directory itself.
Replaced hardcoded relative
git worktree addtargets in command handlers with sharedgitlib_worktree_add_*helpers.Updated
mg infoinventory output to include layout and path guidance fields (Layout,Parent,Default worktree,New sample worktree).Split shell integration tests by layout into separate Bats files and added layout-specific assertions for path placement and inventory output.