git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug report: Minor glitch in "git help" error message
@ 2025-04-17 22:56 Keith Thompson
  2025-04-18  1:24 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Thompson @ 2025-04-17 22:56 UTC (permalink / raw)
  To: git; +Cc: Keith Thompson

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

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"

What's different between what you expected and what actually happened?
The hyphen.

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.)

Anything else you want to add:
Proposed patch (works on my system):

```
commit 148f2e07a7dbdbe72fa0bd4340b76cba12a19a24 (HEAD -> fix-help-bug)
Author: Keith Thompson <Keith.S.Thompson@gmail.com>
Date:   2025-04-17 15:35:44 -0700

    Fix "git help" message for nonexistent subcommand

diff --git builtin/help.c builtin/help.c
index c257079ceb..792549864f 100644
--- builtin/help.c
+++ builtin/help.c
@@ -450,7 +450,7 @@ static const char *cmd_to_page(const char *git_cmd)
  else if (!strcmp("scalar", git_cmd))
  return xstrdup(git_cmd);
  else
- return xstrfmt("git%s", git_cmd);
+ return xstrfmt("git-%s", git_cmd);
 }

 static void setup_man_path(void)
```

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.49.0
cpu: x86_64
built from commit: 683c54c999c301c2cd6f715c411407c413b1d84e
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
libcurl: 8.5.0
OpenSSL: OpenSSL 3.0.13 30 Jan 2024
zlib: 1.3
uname: Linux 6.11.0-24-generic #24~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC
Tue Mar 25 20:14:34 UTC 2 x86_64
compiler info: gnuc: 13.3
libc info: glibc: 2.39
$SHELL (typically, interactive shell): /o/bin/bash


[Enabled Hooks]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-18 13:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 22:56 Bug report: Minor glitch in "git help" error message Keith Thompson
2025-04-18  1:24 ` Junio C Hamano
2025-04-18  3:52   ` Keith Thompson
2025-04-18  9:16     ` Jeff King
2025-04-18 13:27       ` Junio C Hamano

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).