git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Sean Allred <allred.sean@gmail.com>, git@vger.kernel.org
Subject: Re: Custom subcommand help handlers
Date: Wed, 22 Dec 2021 18:44:38 +0100	[thread overview]
Message-ID: <211222.865yrgplu9.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.2112221640340.347@tvgsbejvaqbjf.bet>


On Wed, Dec 22 2021, Johannes Schindelin wrote:

> Hi Ævar,
>
> On Tue, 21 Dec 2021, Ævar Arnfjörð Bjarmason wrote:
>
>> On Mon, Dec 20 2021, Johannes Schindelin wrote:
>>
>> > On Sat, 18 Dec 2021, Sean Allred wrote:
>> >
>> >> 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. [...]
>> >>
>> >> What's the best way to go about this?
>> >
>> > I think you might need to be a bit more careful than just looking whether
>> > the command in question is a built-in or not. It could be delivered as a
>> > script or executable inside `libexec/git-core`. So maybe check that,
>> > something like this:
>> >
>> > -- snip --
>> > [...]
>> > -- snap --
>> >
>> > Of course, this might break existing users' setups where they ship a Git
>> > command together with a manual page.
>> >
>> > A potential remedy against that would be, as you say, a config option.
>> > Maybe defaulting to the manual page if `help.format` is `man`, otherwise
>> > defaulting to passing `--help` to the command.
>>
>> What are the cases that require us to inexpect our --exec-path at
>> runtime, as opposed to having a list of commands we know we put there at
>> "install" time?
>
> It is a simple solution. Why even suggest a complex alternative, I wonder.

You're suggesting the more complex alternative.

We already have a way in that same file to dump both built-ins and other
known commands:

	git --list-cmds=builtins
	git --list-cmds=main

And isn't your is_in_git_exec_path() basically a re-implementation of
what we already get from:

	git --list-cmds=others

?

Hence my question. I.e. if you don't have git-send-email installed why
would you take your is_in_git_exec_path()? I.e. start treating it as
"others" would be treated. We know it's ours, it's just not installed at
the moment.

But those aren't the same thing, so either you didn't know that we have
this data already, or the difference is important for some reason you
haven't explained.

  reply	other threads:[~2021-12-22 17:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18 16:08 Custom subcommand help handlers Sean Allred
2021-12-20 11:11 ` Ævar Arnfjörð Bjarmason
2021-12-20 12:37   ` Erik Cervin Edin
2021-12-20 22:54     ` brian m. carlson
2021-12-20 23:06       ` Junio C Hamano
2021-12-21  9:12         ` Erik Cervin Edin
2021-12-22 16:19         ` Johannes Schindelin
2021-12-22 19:53           ` Junio C Hamano
2021-12-22 23:40             ` Erik Cervin Edin
2021-12-23  0:11               ` Junio C Hamano
2021-12-23 11:33                 ` Erik Cervin Edin
2021-12-23 15:07             ` Philip Oakley
2021-12-24  0:16               ` Junio C Hamano
2021-12-24 11:26                 ` Philip Oakley
2022-02-12 22:29                   ` Sean Allred
2021-12-20 22:39 ` Johannes Schindelin
2021-12-21  2:51   ` Ævar Arnfjörð Bjarmason
2021-12-22 16:16     ` Johannes Schindelin
2021-12-22 17:44       ` Ævar Arnfjörð Bjarmason [this message]
2022-02-12 22:23   ` Sean Allred

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=211222.865yrgplu9.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=allred.sean@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).