Identity
identity
Git identity resolution with schedule-based profile switching.
GitIdentity
GitProfileConfig
Bases: BaseModel
Full git-profiles.toml configuration.
Source code in packages/axm-git/src/axm_git/core/identity.py
Schedule
Bases: BaseModel
Schedule configuration with rules.
Source code in packages/axm-git/src/axm_git/core/identity.py
ScheduleRule
Bases: BaseModel
A time-based rule mapping to a profile.
days/start/end are validated at construction so a config
typo ("monday" instead of "mon", "9h00" instead of
"09:00") is caught by model_validate — which _load_from_file
already degrades to None + WARNING — rather than raising a raw
KeyError/ValueError deep inside _matches_schedule and
crashing every downstream git_commit.
Source code in packages/axm-git/src/axm_git/core/identity.py
author_args(identity)
Build --author arguments for a git command.
load_config(config_path=None)
Load and validate git-profiles configuration.
With an explicit config_path, parse that exact TOML file (unchanged
legacy form). With config_path=None (the default), resolve from the
axm_config single store [git] section, falling back to the legacy
~/axm/git-profiles.toml (with a migration WARNING) only while the
store has no [git] section. Returns None when no config is
resolvable anywhere.
Source code in packages/axm-git/src/axm_git/core/identity.py
resolve_by_override(config, profile_override)
Resolve identity from an explicit profile override.
Returns the matching identity, or None when profile_override
is None or names an unknown profile.
Source code in packages/axm-git/src/axm_git/core/identity.py
resolve_by_schedule(config, workspace_path, now)
Resolve identity from schedule rules for AXM workspaces.
Returns None when the schedule is disabled, the path is outside
AXM workspaces, or no schedule rule matches.
Source code in packages/axm-git/src/axm_git/core/identity.py
resolve_identity(workspace_path, *, now=None, profile_override=None, config_path=None)
Resolve the git identity for the given workspace.
Returns None when no config is available or an unknown profile
is requested via profile_override. An unknown profile_override
(a typo, or a request against an empty profile set) emits a
WARNING naming the requested profile and the available ones
before falling back to None — observability, not a hard failure.