Monorepo management for opam overlays
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf(monopam): skip monorepo scan and add .gitignore support to add_all

commit_pending was calling add_all on the monorepo (300k files including
_build/ and _opam/), causing push to hang. The monorepo is already
committed by the user, so skip it entirely. Also add .gitignore parsing
to add_all so ignored directories are never traversed, and only run
verify_cache on cache hits to avoid scanning 361k entries on every split.

+4 -4
+4 -4
lib/push.ml
··· 151 151 Log.warn (fun m -> m "Failed to commit in %s: %s" name e))) 152 152 153 153 let workspace_repos ~proc ~fs ~config ~force ~push_mono = 154 - let push_repo name path = 154 + let push_repo ~commit name path = 155 155 if Git.Repository.is_repo ~fs path then begin 156 156 let repo = Git.Repository.open_repo ~fs path in 157 157 match Git.Repository.remote_url repo "origin" with 158 158 | None -> Log.debug (fun m -> m "%s has no origin remote, skipping" name) 159 159 | Some _ -> ( 160 - commit_pending ~fs path name; 160 + if commit then commit_pending ~fs path name; 161 161 let branch = 162 162 Git.Repository.current_branch repo |> Option.value ~default:"main" 163 163 in ··· 178 178 in 179 179 let mono = Config.Paths.monorepo config in 180 180 let opam_repo = Config.Paths.opam_repo config in 181 - if push_mono then push_repo "mono" mono; 182 - push_repo "opam-repo" opam_repo 181 + if push_mono then push_repo ~commit:false "mono" mono; 182 + push_repo ~commit:true "opam-repo" opam_repo 183 183 184 184 (** {1 Main Push Operation} *) 185 185