···336336 if not (file_exists ~fs (Filename.concat dir ".git")) then
337337 Error (Printf.sprintf "%s: No .git directory found" dir)
338338 else
339339- (* Build sed command to delete all AI attribution patterns from messages *)
339339+ (* Build sed command to delete all AI attribution patterns from messages.
340340+ Escape forward slashes in patterns for sed compatibility. *)
341341+ let escape_slashes s =
342342+ let buf = Buffer.create (String.length s) in
343343+ String.iter
344344+ (fun c ->
345345+ if c = '/' then Buffer.add_string buf "\\/" else Buffer.add_char buf c)
346346+ s;
347347+ Buffer.contents buf
348348+ in
340349 let sed_args =
341350 ai_message_patterns
342342- |> List.map (fun p -> "-e '/" ^ p ^ "/d'")
351351+ |> List.map (fun p -> "-e '/" ^ escape_slashes p ^ "/d'")
343352 |> String.concat " "
344353 in
345354 (* Build env-filter to replace AI authors with current user *)