diff options
author | René Scharfe <l.s.r@web.de> | 2025-07-25 20:41:24 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-07-25 16:34:13 -0700 |
commit | 161e895e42f4fad83828c1c954adb9375f4b0092 (patch) | |
tree | 158e2871cfbf5dd1001c82ced451ebb2c57f9564 /lib/commit.tcl | |
parent | e4ef0485fd78fcb05866ea78df35796b904e4a8e (diff) |
git: show alias info only with lone -h
Builtin commands show usage information on stdout if called with -h as
their only option, usage.c::show_usage_if_asked() makes sure of that.
Aliases show alias information on stderr if called with -h as the first
option since a9a60b94cc (git.c: handle_alias: prepend alias info when
first argument is -h, 2018-10-09). This is surprising when using
aliases for commands that take -h as a normal argument among others,
like git grep.
Tighten the condition and show the alias information only if -h is the
only option given, to be consistent with builtins.
It's probably still is a good idea to write to stderr, as an alias
command doesn't have to be a builtin and could instead produce output
with just -h that might be spoiled by an extra alias info line.
Reported-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'lib/commit.tcl')
0 files changed, 0 insertions, 0 deletions