Index
core
Core logic — subprocess runners and semver computation.
GitIdentity
GitProfileConfig
Bases: BaseModel
Full git-profiles.toml configuration.
Source code in packages/axm-git/src/axm_git/core/identity.py
attempt_commit_with_autofix_retry(cmd, files, git_root, first_result, *, working_dir=None)
Re-stage + retry cmd once when a commit hook auto-fixed files.
Detection is on the combined stdout+stderr of first_result: when the
canonical "files were modified" marker is present, the modified
files are captured (git diff --name-only before re-staging), the
spec files are re-staged via the subdir-aware resolver, and cmd is
retried once. Otherwise first_result is returned unchanged.
Source code in packages/axm-git/src/axm_git/core/commit_spec.py
author_args(identity)
Build --author arguments for a git command.
build_commit_result(git_root, message, identity, warnings)
Build a successful commit :class:HookResult.
Reads the current HEAD short hash and assembles the result dict with optional identity and warning fields.
Source code in packages/axm-git/src/axm_git/core/commit_spec.py
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_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.
Source code in packages/axm-git/src/axm_git/core/identity.py
retry_commit_on_autofix(files, cmd, git_root, first_result, *, working_dir=None)
Hook-facing wrapper: return only the retried GitResult.
Thin adapter over :func:attempt_commit_with_autofix_retry for callers
that only need the final result object (the commit-phase hook).
Source code in packages/axm-git/src/axm_git/core/commit_spec.py
validate_commit_spec(spec)
Validate a commit_spec dict (pure; stricter merged contract).
Requires a non-empty message AND a non-empty files list — the
stricter of the two prior per-surface validators. Returns
(spec, error_message) where spec is None when an error is set;
each surface wraps the error string in its own result type.