From 188c10a2d06ab395062bee026663d3470e2f3c82 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 31 Dec 2025 17:43:15 +0000 Subject: [PATCH 1/2] dev Signed-off-by: Rudi Grinberg From a13b916c7315282a5ad408d22b53a8552ada4a8d Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 27 Jan 2026 23:07:32 +0000 Subject: [PATCH 2/2] fix: dune promotion show should write to stdout Signed-off-by: Rudi Grinberg --- bin/promotion.ml | 7 +++---- doc/changes/fixed/13481.md | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 doc/changes/fixed/13481.md diff --git a/bin/promotion.ml b/bin/promotion.ml index 9d5bd00fc86..afc9ed1c52d 100644 --- a/bin/promotion.ml +++ b/bin/promotion.ml @@ -128,9 +128,7 @@ module Show = struct List.iter present ~f:(fun file -> let correction_file = Diff_promotion.File.correction_file file in if Path.exists correction_file - then ( - let contents = Io.read_file correction_file in - Console.printf "%s" contents) + then Io.read_file correction_file |> print_endline else User_warning.emit [ Pp.textf @@ -142,11 +140,12 @@ module Show = struct let term = let+ builder = Common.Builder.term and+ files = + (* CR-someday rgrinberg: should we really allow more than one file? How + are users supposed to distinguish the output? *) Arg.(value & pos_all Cmdliner.Arg.file [] & info [] ~docv:"FILE" ~doc:None) in let common, _config = Common.init builder in let files_to_promote = files_to_promote ~common files in - (* CR-soon rgrinberg: remove pointless args *) let db = Diff_promotion.load_db () in let { Diff_promotion.present = _; missing } = Diff_promotion.partition_db db files_to_promote diff --git a/doc/changes/fixed/13481.md b/doc/changes/fixed/13481.md new file mode 100644 index 00000000000..3473f874e42 --- /dev/null +++ b/doc/changes/fixed/13481.md @@ -0,0 +1,2 @@ +- Print `$ dune promotion show` output to stdout rather than stderr (#13481, + @rgrinberg)