Monorepo management for opam overlays
0
fork

Configure Feed

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

Fix non-fast-forward detection to use is_infix, not is_prefix

The git push stderr starts with "To /path/..." not with the error
keywords. Use Astring.String.is_infix to search anywhere in stderr.

Also reverted the auto-force and checkout_tree plumbing — the
non-fast-forward on local checkouts is a one-time consequence of
the split skip fix (old split included no-op commits, new split
correctly skips them). Resolved with monopam push --force once.

+3 -17
+3 -3
lib/ctx.ml
··· 53 53 | Git_error (Git_cli.Command_failed (cmd, result)) 54 54 when String.starts_with ~prefix:"git push" cmd -> 55 55 if 56 - Astring.String.is_prefix ~affix:"non-fast-forward" result.Git_cli.stderr 57 - || Astring.String.is_prefix ~affix:" ! [rejected]" result.Git_cli.stderr 58 - || Astring.String.is_prefix ~affix:"fetch first" result.Git_cli.stderr 56 + Astring.String.is_infix ~affix:"non-fast-forward" result.Git_cli.stderr 57 + || Astring.String.is_infix ~affix:"[rejected]" result.Git_cli.stderr 58 + || Astring.String.is_infix ~affix:"fetch first" result.Git_cli.stderr 59 59 then 60 60 Some 61 61 "Use 'monopam push --force' to overwrite diverged history (e.g. \
-14
lib/push.ml
··· 45 45 ~refspec ~force:(clean || force) () 46 46 with 47 47 | Ok () -> Ok () 48 - | Error (Git_cli.Command_failed (_, result) as e) 49 - when (not force) 50 - && (Astring.String.is_prefix ~affix:"non-fast-forward" 51 - result.Git_cli.stderr 52 - || Astring.String.is_prefix ~affix:" ! [rejected]" 53 - result.Git_cli.stderr 54 - || Astring.String.is_prefix ~affix:"fetch first" 55 - result.Git_cli.stderr) -> 56 - Log.warn (fun m -> 57 - m 58 - "Push to %s rejected (non-fast-forward). Use --force to \ 59 - overwrite (e.g. after git filter-repo)." 60 - checkout_url); 61 - Error (Ctx.Git_error e) 62 48 | Error e -> Error (Ctx.Git_error e))) 63 49 64 50 (** Resolve the fetch URL for a package: sources.toml entry > dev-repo fallback.