git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Keith Thompson <Keith.S.Thompson@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug report: Minor glitch in "git help" error message
Date: Thu, 17 Apr 2025 18:24:46 -0700	[thread overview]
Message-ID: <xmqq5xj2clcx.fsf@gitster.g> (raw)
In-Reply-To: <CAAHpriMkqapiJuUGimn-i8SqcZmvmc=Wpk6oUr844uAkCYgMxA@mail.gmail.com> (Keith Thompson's message of "Thu, 17 Apr 2025 15:56:37 -0700")

Keith Thompson <Keith.S.Thompson@gmail.com> writes:

> What did you do before the bug happened? (Steps to reproduce your issue)
> git help nosuchcommand
>
> What did you expect to happen? (Expected behavior)
> An error message: "No manual entry for git-nosuchcommand"
>
> What happened instead? (Actual behavior)
> An error message: "No manual entry for gitnosuchcommand"

I am of two minds.  When "git help" is asked for commands, your
suggestion does make sense, i.e.

    $ git help dog-file
    No manual entry for gitdog-file

And these two are moral equivalents.

    $ git help cat-file
    $ man git-cat-file

But "git help" can ask for things other than subcommands.
For example, these two are equivalents.

    $ git help glossary
    $ man gitglossary

Notice the lack of "-" there?

> If "nosuchcommand" were a git command, the man page would be
> readable by typing "man git-nosuchcommand".  The error message
> should reflect that.  (The error message is actually produced
> by the "man" command.)

In other words, if "nosuchguide" were a concept with guide, the man
page is readable by "man gitnosuchguide", and the error message does
reflect it.

Unlike "git foo --help", where it is clear that the user expected a
subommand "foo", when the user says "git help foo", we cannot tell
whether the user asked for documentation for a command or a concept
guide, so adding "-" there is a bit like robbing Peter to pay Paul.

Thanks for a report.



  reply	other threads:[~2025-04-18  1:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17 22:56 Bug report: Minor glitch in "git help" error message Keith Thompson
2025-04-18  1:24 ` Junio C Hamano [this message]
2025-04-18  3:52   ` Keith Thompson
2025-04-18  9:16     ` Jeff King
2025-04-18 13:27       ` 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=xmqq5xj2clcx.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Keith.S.Thompson@gmail.com \
    --cc=git@vger.kernel.org \
    /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).