From 908973b5c08a8b7b624880843c512e8bddf37896 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 15 Jan 2026 18:25:10 +0000 Subject: Implement git config inherit system --- makima/src/server/handlers/mesh_daemon.rs | 34 +++++++++++++++++++++++++++++++ makima/src/server/state.rs | 7 +++++++ 2 files changed, 41 insertions(+) (limited to 'makima/src/server') diff --git a/makima/src/server/handlers/mesh_daemon.rs b/makima/src/server/handlers/mesh_daemon.rs index 0d00f5b..9833d51 100644 --- a/makima/src/server/handlers/mesh_daemon.rs +++ b/makima/src/server/handlers/mesh_daemon.rs @@ -410,6 +410,19 @@ pub enum DaemonMessage { /// User-provided checkpoint message message: String, }, + /// Notification that git config was inherited + GitConfigInherited { + /// Whether the operation succeeded + success: bool, + /// Git user.email that was inherited + #[serde(rename = "userEmail")] + user_email: Option, + /// Git user.name that was inherited + #[serde(rename = "userName")] + user_name: Option, + /// Error message if operation failed + error: Option, + }, } /// Validated daemon authentication result. @@ -1239,6 +1252,27 @@ async fn handle_daemon_connection(socket: WebSocket, state: SharedState, auth_re }); } } + Ok(DaemonMessage::GitConfigInherited { + success, + user_email, + user_name, + error, + }) => { + if success { + tracing::info!( + daemon_id = %daemon_uuid, + user_email = ?user_email, + user_name = ?user_name, + "Daemon inherited git config" + ); + } else { + tracing::warn!( + daemon_id = %daemon_uuid, + error = ?error, + "Failed to inherit git config" + ); + } + } Err(e) => { tracing::warn!("Failed to parse daemon message: {}", e); } diff --git a/makima/src/server/state.rs b/makima/src/server/state.rs index 6a56f21..479eadf 100644 --- a/makima/src/server/state.rs +++ b/makima/src/server/state.rs @@ -413,6 +413,13 @@ pub enum DaemonCommand { delete_branch: bool, }, + /// Inherit git config (user.email, user.name) from a directory + InheritGitConfig { + /// Directory to read git config from (defaults to daemon's working directory) + #[serde(rename = "sourceDir")] + source_dir: Option, + }, + /// Error response Error { code: String, message: String }, } -- cgit v1.2.3