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

Re: Custom subcommand help handlers

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Dec 20, 2021, 11:11 UTC
Message-ID
<211220.86k0fzwmq2.gmgdl@evledraar.gmail.com>
In-Reply-To
<CABceR4ZW4rRWZnH0ZBkWty_H84Z4CmXque_LO+1edETEWrO8PQ@mail.gmail.com>
On Sat, Dec 18 2021, Sean Allred wrote:
Show 27 quoted lines
> Hi folks,
>
> I've got a custom subcommand I'm distributing in my company to
> integrate with our bug-tracker. It's a pretty robust utility and has
> its own help function, but running `git foo --help` doesn't pass
> --help to my git-foo utility. I asked a question[1] about this
> scenario on the Windows fork and they directed me upstream.
>
> It sounds like `git foo --help` is internally consumed as `git help
> foo`, which forwards requests to info/man/web handlers per config.
> Being on Windows and knowing my peers as I do, the vast majority of my
> users won't be familiar with info or man. The HTML documentation used
> by the web handler is in a Git4Win-controlled installation directory
> that I'd really rather not touch/maintain. I really just want `git foo
> --help` to call `git-foo --help`.
>
> What's the best way to go about this?
>
> In the event the best next step is to start a patch, does it sound
> reasonable to simply not perform this `git foo --help` -> `git help
> foo` transformation for non-builtins? Or, while I don't relish the
> idea, would some kind of config option be needed?
>
> Best,
> Sean Allred
>
> [1]: https://github.com/git-for-windows/git/discussions/3553

I don't know if there's a solution that'll please everyone here, but it's definitely not narrowing this to built-ins. E.g. "git send-email --help" will expect to show the manual, so will "git annex --help".

Previous: Sean AllredNext: Erik Cervin Edin
Message 2 of 20 in “Custom subcommand help handlers”
  1. Sean AllredDec 18, 2021
  2. Ævar Arnfjörð BjarmasonDec 20, 2021
  3. Erik Cervin EdinDec 20, 2021
  4. brian m. carlsonDec 20, 2021
  5. Junio C HamanoDec 20, 2021
  6. Erik Cervin EdinDec 21, 2021
  7. Johannes SchindelinDec 22, 2021
  8. Junio C HamanoDec 22, 2021
  9. Erik Cervin EdinDec 22, 2021
  10. Junio C HamanoDec 23, 2021
  11. Erik Cervin EdinDec 23, 2021
  12. Philip OakleyDec 23, 2021
  13. Junio C HamanoDec 24, 2021
  14. Philip OakleyDec 24, 2021
  15. Sean AllredFeb 12, 2022
  16. Johannes SchindelinDec 20, 2021
  17. Ævar Arnfjörð BjarmasonDec 21, 2021
  18. Johannes SchindelinDec 22, 2021
  19. Ævar Arnfjörð BjarmasonDec 22, 2021
  20. Sean AllredFeb 12, 2022

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.