Index
core
Core logic — subprocess runners, semver computation, repository lock.
GitIdentity
GitProfileConfig
Bases: BaseModel
Full git-profiles.toml configuration.
Source code in packages/axm-git/src/axm_git/core/identity.py
RepositoryLockTimeoutError
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_cmd(message, body, *, skip_hooks=True, author=None)
Build the git commit argument list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Commit summary line. |
required |
body
|
str | None
|
Optional extended commit body. |
required |
skip_hooks
|
bool
|
Append |
True
|
author
|
str | None
|
Git |
None
|
Source code in packages/axm-git/src/axm_git/core/commit_cmd.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
repository_lock(repo_path, *, timeout)
Hold the integration lock of repo_path's repository for the block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path
|
str | Path
|
Any directory inside the repository or one of its worktrees. |
required |
timeout
|
float
|
Seconds to wait for another holder to release the lock
( |
required |
Yields:
| Type | Description |
|---|---|
Path
|
The lock file's path. |
Raises:
| Type | Description |
|---|---|
ValueError
|
repo_path is not inside a git repository. |
RepositoryLockTimeoutError
|
another holder kept the lock past timeout. |
Source code in packages/axm-git/src/axm_git/core/lock.py
repository_lock_path(repo_path)
Return the lock file of the repository holding repo_path.
Every worktree of one repository resolves to the same path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo_path
|
str | Path
|
Any directory inside a git repository or one of its worktrees. |
required |
Returns:
| Type | Description |
|---|---|
Path | None
|
|
Path | None
|
cannot place repo_path in a repository. |
Source code in packages/axm-git/src/axm_git/core/lock.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
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.