Pure OCaml xxhash implementation

Fix fork: prompt for push URL, fix split_commit display truncation

- Prompt for remote push URL if not provided on command line
(skipped with --yes or --dry-run)
- Fix pp_fork_result to only truncate git SHA hashes (40 hex chars),
not descriptive strings like "(fresh package)"

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

+26 -3
+18
monopam/bin/main.ml
··· 1259 1259 | Some s -> String.lowercase_ascii (String.trim s) = "y" 1260 1260 | None -> false 1261 1261 1262 + (* Prompt for optional string input *) 1263 + let prompt_string prompt = 1264 + Printf.printf "%s %!" prompt; 1265 + match In_channel.(input_line stdin) with 1266 + | Some s -> 1267 + let s = String.trim s in 1268 + if s = "" then None else Some s 1269 + | None -> None 1270 + 1262 1271 (* Fork command *) 1263 1272 1264 1273 let fork_cmd = ··· 1328 1337 with_verse_config env @@ fun config -> 1329 1338 let fs = Eio.Stdenv.fs env in 1330 1339 let proc = Eio.Stdenv.process_mgr env in 1340 + (* Prompt for URL if not provided (unless --yes or --dry-run) *) 1341 + let url = 1342 + match url with 1343 + | Some _ -> url 1344 + | None when yes || dry_run -> None 1345 + | None -> 1346 + Fmt.pr "Remote push URL (leave empty to skip): %!"; 1347 + prompt_string "" 1348 + in 1331 1349 (* Build the plan *) 1332 1350 match Monopam.Fork_join.plan_fork ~proc ~fs ~config ~name ?push_url:url ~dry_run () with 1333 1351 | Error e ->
+8 -3
monopam/lib/fork_join.ml
··· 165 165 } 166 166 167 167 let pp_fork_result ppf (r : fork_result) = 168 + (* Only truncate if it looks like a git SHA (40 hex chars), otherwise show full string *) 169 + let commit_display = 170 + if String.length r.split_commit = 40 && 171 + String.for_all (fun c -> (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f')) r.split_commit 172 + then String.sub r.split_commit 0 7 173 + else r.split_commit 174 + in 168 175 Fmt.pf ppf "@[<v>Forked subtree '%s':@, Split commit: %s@, Local repo: %a@," 169 - r.name 170 - (String.sub r.split_commit 0 (min 7 (String.length r.split_commit))) 171 - Fpath.pp r.src_path; 176 + r.name commit_display Fpath.pp r.src_path; 172 177 (match r.push_url with 173 178 | Some url -> Fmt.pf ppf " Push URL: %s@," url 174 179 | None -> ());