/** * Git commit detection utility * * Provides auto-detection of current git commit SHA with fallback handling * for edge cases like non-git repositories. * * IMPORTANT: Uses spawnSync instead of execSync to avoid WSL2 TTY/GPG hangs. * execSync spawns a shell which can get into weird states on WSL2. */ /** * Get the current git commit SHA (short form) * * @returns Current git commit SHA (short form, 7 characters), or "unknown" for non-git repos * * Behavior: * - Returns short commit SHA (7 chars) in normal git repository * - Returns "unknown" when not in a git repository * - Respects LEX_DEFAULT_COMMIT environment variable as override * - Respects LEX_GIT_MODE=off to skip git calls entirely * - Caches result for performance * * @example * ```ts * const commit = getCurrentCommit(); * console.log(`Current commit: ${commit}`); * ``` */ export declare function getCurrentCommit(): string; /** * Clear the commit cache * * Useful for testing or when the commit might have changed * (e.g., after a new commit) */ export declare function clearCommitCache(): void;