pub fn git_commit(
message: &str,
git_user_name: Option<&str>,
git_user_email: Option<&str>,
executor: Option<&dyn ProcessExecutor>,
) -> Result<Option<Oid>>Expand description
Create a commit.
Similar to git commit -m <message>.
Handles both initial commits (no HEAD yet) and subsequent commits.
§Identity Resolution
The git commit identity (name and email) is resolved using the following priority:
- Git config (via libgit2) - primary source
- Provided
git_user_nameandgit_user_emailparameters (overrides) - Environment variables (
RALPH_GIT_USER_NAME,RALPH_GIT_USER_EMAIL) - Ralph config file (read by caller, passed as parameters)
- System username + derived email (sane fallback)
- Default values (“Ralph Workflow”, “ralph@localhost”) - last resort
Partial overrides are supported: CLI args/env vars/config can override individual fields (name or email) from git config.