Pure OCaml xxhash implementation

Squashed 'monopam/' changes from a9b9b636..6efbb2e4

6efbb2e4 Refuse to sync when monorepo has uncommitted changes

git-subtree-dir: monopam
git-subtree-split: 6efbb2e42d0144b64bab58799fdb221d8ab9e90a

+14 -1
+13 -1
lib/monopam.ml
··· 26 26 | Repo_error of Opam_repo.error 27 27 | Git_error of Git.error 28 28 | Dirty_state of Package.t list 29 + | Monorepo_dirty 29 30 | Package_not_found of string 30 31 | Claude_error of string 31 32 ··· 37 38 Fmt.pf ppf "Dirty packages: %a" 38 39 Fmt.(list ~sep:comma (using Package.name string)) 39 40 pkgs 41 + | Monorepo_dirty -> Fmt.pf ppf "Monorepo has uncommitted changes" 40 42 | Package_not_found name -> Fmt.pf ppf "Package not found: %s" name 41 43 | Claude_error msg -> Fmt.pf ppf "Claude error: %s" msg 42 44 ··· 74 76 Some 75 77 "Commit changes in the monorepo first: cd mono && git add -A && git \ 76 78 commit" 79 + | Monorepo_dirty -> 80 + Some "Commit or stash your changes first: git status && git add -A && git commit" 77 81 | Package_not_found _ -> 78 82 Some "Check available packages: ls opam-repo/packages/" 79 83 | Claude_error msg when String.starts_with ~prefix:"Failed to decode" msg -> ··· 1579 1583 match ensure_monorepo_initialized ~proc ~fs:fs_t ~config with 1580 1584 | Error e -> Error e 1581 1585 | Ok () -> ( 1586 + (* Check for uncommitted changes in monorepo *) 1587 + let monorepo = Config.Paths.monorepo config in 1588 + if Git.is_dirty ~proc ~fs:fs_t monorepo then begin 1589 + Log.err (fun m -> m "Monorepo has uncommitted changes"); 1590 + Error Monorepo_dirty 1591 + end 1592 + else begin 1582 1593 (* Regenerate opam-repo from monorepo to ensure URLs are up to date *) 1583 1594 regenerate_opam_repo ~fs:(fs_t :> _ Eio.Path.t) ~config (); 1584 1595 match discover_packages ~fs:(fs_t :> _ Eio.Path.t) ~config () with ··· 1901 1912 1902 1913 Ok summary 1903 1914 end 1904 - end) 1915 + end 1916 + end) 1905 1917 1906 1918 (* Opam metadata sync: copy .opam files from monorepo subtrees to opam-repo *) 1907 1919
+1
lib/monopam.mli
··· 50 50 | Git_error of Git.error (** Git operation error *) 51 51 | Dirty_state of Package.t list 52 52 (** Operation blocked due to dirty packages *) 53 + | Monorepo_dirty (** Monorepo has uncommitted changes *) 53 54 | Package_not_found of string (** Named package not found in opam repo *) 54 55 | Claude_error of string (** Claude API or response parsing error *) 55 56