Monorepo management for opam overlays
0
fork

Configure Feed

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

Fix monopam join --url flag to work for simple joins

When --url is provided without --from, use the URL for cloning
and treat the positional argument as the subtree name.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+11 -7
+11 -7
bin/main.ml
··· 1577 1577 `S Manpage.s_examples; 1578 1578 `P "Join a repository:"; 1579 1579 `Pre "monopam join https://github.com/someone/some-lib"; 1580 - `P "Join with a custom name:"; 1580 + `P "Join with explicit name using --url:"; 1581 + `Pre "monopam join --url https://tangled.org/handle/sortal sortal"; 1582 + `P "Join with a custom name using --as:"; 1581 1583 `Pre "monopam join https://github.com/someone/some-lib --as my-lib"; 1582 1584 `P "Join with upstream tracking (for forks):"; 1583 1585 `Pre "monopam join https://github.com/me/cohttp --upstream https://github.com/mirage/cohttp"; ··· 1589 1591 in 1590 1592 let info = Cmd.info "join" ~doc ~man in 1591 1593 let url_or_pkg_arg = 1592 - let doc = "Git URL to join, or package name (with --from)" in 1593 - Arg.(required & pos 0 (some string) None & info [] ~docv:"URL|PACKAGE" ~doc) 1594 + let doc = "Git URL to join, or subtree name (when using --url)" in 1595 + Arg.(required & pos 0 (some string) None & info [] ~docv:"URL|NAME" ~doc) 1594 1596 in 1595 1597 let as_arg = 1596 1598 let doc = "Override subtree directory name" in ··· 1605 1607 Arg.(value & opt (some string) None & info [ "from" ] ~docv:"HANDLE" ~doc) 1606 1608 in 1607 1609 let fork_url_arg = 1608 - let doc = "Your fork URL (required with --from)" in 1610 + let doc = "Git URL to clone from (makes positional arg the subtree name)" in 1609 1611 Arg.(value & opt (some string) None & info [ "url" ] ~docv:"URL" ~doc) 1610 1612 in 1611 1613 let dry_run_arg = ··· 1619 1621 let proc = Eio.Stdenv.process_mgr env in 1620 1622 match from with 1621 1623 | Some handle -> 1622 - (* Join from verse member *) 1624 + (* Join from verse member - requires --url for your fork *) 1623 1625 (match fork_url with 1624 1626 | None -> 1625 1627 Fmt.epr "Error: --url is required when using --from@."; ··· 1644 1646 Fmt.epr "Error: %a@." Monopam.Fork_join.pp_error_with_hint e; 1645 1647 `Error (false, "join failed")) 1646 1648 | None -> 1647 - (* Normal join from URL *) 1648 - match Monopam.Fork_join.join ~proc ~fs ~config ~url:url_or_pkg ?name:as_name ?upstream ~dry_run () with 1649 + (* Normal join from URL - use --url if provided, otherwise positional arg *) 1650 + let url = match fork_url with Some u -> u | None -> url_or_pkg in 1651 + let name = match fork_url with Some _ -> Some url_or_pkg | None -> as_name in 1652 + match Monopam.Fork_join.join ~proc ~fs ~config ~url ?name ?upstream ~dry_run () with 1649 1653 | Ok result -> 1650 1654 if dry_run then begin 1651 1655 Fmt.pr "Would join '%s':@." result.name;