From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
git@vger.kernel.org,
"Ignacy Gawedzki" <ignacy.gawedzki@green-communications.fr>
Subject: Re: [PATCH 1/3] show-ref: remove unused custom handling of -h
Date: Fri, 24 Sep 2021 14:21:34 -0700 [thread overview]
Message-ID: <xmqqfsttsm8x.fsf@gitster.g> (raw)
In-Reply-To: <b0b1c64d-9b53-a64f-73db-b8552c7b66a2@web.de> ("René Scharfe"'s message of "Fri, 24 Sep 2021 22:53:56 +0200")
René Scharfe <l.s.r@web.de> writes:
> Am 24.09.21 um 21:24 schrieb Junio C Hamano:
>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>>> Since b92891f9783 (parseopt: add PARSE_OPT_NO_INTERNAL_HELP,
>>> 2009-03-08) parse_options() has handled "-h" unless told not to, so
>>> when show-ref was migrated to parse_options() in
>>> 69932bc6117 (show-ref: migrate to parse-options, 2009-06-20) the
>>> custom "-h" handling that was retained did nothing.
>>>
>>> The option was then hidden in e62b3935056 (Show usage string for 'git
>>> show-ref -h', 2009-11-09), but that OPT_BOOLEAN didn't do
>>> anything. Let's just remove this dead code.
>>>
>>> Reported-by: Ignacy Gawedzki <ignacy.gawedzki@green-communications.fr>
>>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>>> ---
>>> builtin/show-ref.c | 2 --
>>> 1 file changed, 2 deletions(-)
>>
>> While this is a fine no-op, I am not sure this "fixes" complaint
>> in Ignacy's report. "git show-ref -h" would (and should) show the
>> short-help, no?
>>
>
> It would, but -h is not a no-op without this patch. The option is
> equivalent to --heads as long as it's not the only argument. E.g. it
> has an effect in "git show-ref -h HEA." or "git show-ref -hh".
Ah, so this actively breaks the command? Yeah, thanks---I smelled
something fishy in the change.
next prev parent reply other threads:[~2021-09-24 21:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 14:19 Wrong option -h in grep, ls-remote, and show-ref Ignacy Gawedzki
2021-09-24 16:51 ` [PATCH 0/3] show-ref, ls-remote, grep: fix -h handling Ævar Arnfjörð Bjarmason
2021-09-24 16:51 ` [PATCH 1/3] show-ref: remove unused custom handling of -h Ævar Arnfjörð Bjarmason
2021-09-24 19:24 ` Junio C Hamano
2021-09-24 20:53 ` René Scharfe
2021-09-24 21:21 ` Junio C Hamano [this message]
2021-09-24 16:51 ` [PATCH 2/3] ls-remote: remove documentation for custom -h option Ævar Arnfjörð Bjarmason
2021-09-24 17:11 ` SZEDER Gábor
2021-09-24 17:54 ` Jeff King
2021-09-24 18:17 ` Junio C Hamano
2021-09-24 16:51 ` [PATCH 3/3] grep: pass PARSE_OPT_NO_INTERNAL_HELP, fix odd -h handling Ævar Arnfjörð Bjarmason
2021-09-24 18:12 ` Wrong option -h in grep, ls-remote, and show-ref Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqfsttsm8x.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=ignacy.gawedzki@green-communications.fr \
--cc=l.s.r@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).