Expand description
Git identity resolution with fallback chain.
This module provides a comprehensive git identity resolution system that:
- Works with git config as the primary source (via libgit2 in caller)
- Adds Ralph-specific configuration options (config file, env vars, CLI args)
- Implements sensible fallbacks (system username, default values)
- Provides clear error messages when identity cannot be determined
§Priority Chain
The identity is resolved in the following order (matches standard git behavior):
- Git config (via libgit2) - primary source (local .git/config, then global ~/.gitconfig)
- Explicit CLI args - only used when git config is missing
- Environment variables (
RALPH_GIT_USER_NAME,RALPH_GIT_USER_EMAIL) - fallback - Ralph config file (
[general]section withgit_user_name,git_user_email) - System username + derived email (sane fallback)
- Default values (“Ralph Workflow”, “ralph@localhost”) - last resort
Structs§
- GitIdentity
- Git user identity information.
Functions§
- default_
identity - Get the default git identity (last resort).
- fallback_
email - Get a fallback email based on the username.
- fallback_
username - Get the system username as a fallback.