2026-03 mar - expand mg workflow commands#
2026-03-22 - Sunday#
Refactored mg into modular command scripts and tightened branch-switch/remote handling semantics.
Change summary#
Split
mgsubcommands intohome/dot_local/bin/my-git/cmd-*.shmodules, moved shared shell helpers tobash-lib.sh/git-lib.sh, and switched dispatch to dynamic script loading.Moved per-command usage helpers into each subcommand file, keeping only top-level help aggregation in
executable_mg.Replaced global parsed-result state with bash nameref out-parameters for option/worktree outputs to reduce cross-file global coupling.
Renamed helper namespaces and include guards for clarity (
gitlib_*,_MG_INCLUDE_GUARD_*,MG_INCLUDE_GUARD_*).Simplified
self-branchto require existing remotes (no--hostor remote synthesis) and alignedalien-branchto explicitly enforce existing-remote checks.Updated
switchto resolve missing local branches fromoriginfirst, thenupstream, and to fail with explicit guidance tomg new-branch <branch>when not found.Updated
new-branchtocdinto the newly created worktree, and refreshed wrappers/completions/tests/docs snapshots to match behavior.Moved implementation notes from
home/dot_local/bin/my-git/README.mdto Git scripts.Split workflow vs implementation docs:
git-workflownow embeds generated--examplesnapshots for core commands, andgit-scriptsnow carries runtime/module internals.
2026-03-21 - Saturday#
Expanded mg workflows with stronger safety checks, richer usage docs, and new repository management commands.
Change summary#
Added safety preflight checks for branch-name validity, project/worktree path collisions, and remote/remote-branch checks.
Clarified clone host-alias behavior, URL parsing semantics, and command usage output for
--helpand--example.Added discovery commands:
mg infoandmg path.Added branch lifecycle commands:
mg remove-branch(merged-only removal) andmg prune.Added local bare-path remote support for
mg self-branchandmg alien-branch.Added local bare-path source support and
--destdestination override tomg clone.Added
MG_GIT_VERBOSE=1tracing mode to print executed shell commands.Updated Bash/Fish wrappers, Fish completions, and Bats coverage to align with new command behavior.