Expand description
dodot git-show-alias and dodot git-install-alias — the
Tier 2 shell-side glue for the template-magic flow.
Tier 1 (R4) gets you commit-time correctness via the pre-commit
hook. Tier 2 makes interactive git status and git diff show
the truth between commits too, by wrapping git in a shell alias
that runs dodot refresh --quiet first. The clean filter (R6)
does the heavy lifting once the source mtime is fresh; this
alias is what nudges the mtime on every interactive git
invocation.
Two forms:
dodot git-show-alias— print the alias for the user’s shell (detected from$SHELL) so they can copy-paste into their rc file. No filesystem mutation.dodot git-install-alias— write the alias to the user’s rc file (~/.bashrcor~/.zshrc) with an idempotent guard block, mirroring the pre-commit hook installer’s pattern.
Only affects interactive shells. Scripts, editors, and CI that
shell out to git directly are unaffected — exactly what we
want: non-interactive callers get predictable behaviour,
interactive use gets the magic.
Structs§
- Install
Alias Result - Show
Alias Result - Result of
dodot git-show-alias— the alias body the user can paste, plus the rc file we’d write it to (so the rendered output can show “add this to ~/.zshrc”).
Enums§
- Install
Alias Outcome - Outcome of
dodot git-install-alias. MirrorsInstallHookOutcome. - Shell
- Which shell we’re targeting. Detected from
$SHELLfor the bareshow/installflow; the user can override with--shellat the CLI layer.
Functions§
- install_
alias - is_
installed - Cheap “is this rc file already wrapping git via our alias?”
check, used by the future post-
upprompt. Reads the rc file and looks for the guard. Doesn’t error out if the file is missing — that’s a normal “not installed” state. - managed_
block - The full guarded block that
install_aliaswrites (or thatshow_aliasprints for copy-paste). Mirrors the pre-commit hook’smanaged_blockshape. - resolve_
shell - Diagnostic helper for the CLI: detect or validate a shell from
the
--shellCLI value, surfacing a clear error for unknown shells. Returns the resolvedShellor aDodotError::Other. - show_
alias