git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Bug report: Minor glitch in "git help" error message

From
Keith Thompson <keith.s.thompson@gmail.com>
Date
Apr 17, 2025, 22:56 UTC
Message-ID
<CAAHpriMkqapiJuUGimn-i8SqcZmvmc=Wpk6oUr844uAkCYgMxA@mail.gmail.com>

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]
Next: Junio C Hamano
Message 1 of 5 in “Bug report: Minor glitch in "git help" error message”
  1. Keith ThompsonApr 17, 2025
  2. Junio C HamanoApr 18, 2025
  3. Keith ThompsonApr 18, 2025
  4. Jeff KingApr 18, 2025
  5. Junio C HamanoApr 18, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.