aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/merge-recursive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-01-28 13:02:22 -0800
committerJunio C Hamano <gitster@pobox.com>2025-01-28 13:02:22 -0800
commitf0a371a39d8b9945b2e0a414a32aa861614e5352 (patch)
tree5ee935ae11355384d47bc2da81d6a19bf2ae15cb /builtin/merge-recursive.c
parent5f8f7081f7761acdf83d0a4c6819fe3d724f01d7 (diff)
parentf66d1423f528403a33e8984f765801deb1b9cb97 (diff)
downloadgit-f0a371a39d8b9945b2e0a414a32aa861614e5352.tar.gz
Merge branch 'jc/show-usage-help'
The help text from "git $cmd -h" appear on the standard output for some $cmd and the standard error for others. The built-in commands have been fixed to show them on the standard output consistently. * jc/show-usage-help: builtin: send usage() help text to standard output oddballs: send usage() help text to standard output builtins: send usage_with_options() help text to standard output usage: add show_usage_if_asked() parse-options: add show_usage_with_options_if_asked() t0012: optionally check that "-h" output goes to stdout
Diffstat (limited to 'builtin/merge-recursive.c')
-rw-r--r--builtin/merge-recursive.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index 1dd295558b..abfc060e28 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -38,6 +38,12 @@ int cmd_merge_recursive(int argc,
if (argv[0] && ends_with(argv[0], "-subtree"))
o.subtree_shift = "";
+ if (argc == 2 && !strcmp(argv[1], "-h")) {
+ struct strbuf msg = STRBUF_INIT;
+ strbuf_addf(&msg, builtin_merge_recursive_usage, argv[0]);
+ show_usage_if_asked(argc, argv, msg.buf);
+ }
+
if (argc < 4)
usagef(builtin_merge_recursive_usage, argv[0]);