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

Re: [RFC PATCH 1/1] completion: load completion file for external subcommand

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 9, 2018, 22:06 UTC
Message-ID
<xmqq8t9w591b.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180409133627.GA25078@arbeitsviech>
Florian Gamböck <mail@floga.de> writes:
Show 11 quoted lines
> On 2018-04-09 18:36, Junio C Hamano wrote:
>> Florian Gamböck <mail@floga.de> writes:
>>
>> > Good point. I could go even further and ditch the if-construct:
>> >
>> >    ! declare -f $completion_func && declare -f __load_completion &&
>> >        __load_completion "git-$command"
>>
>> I personally find that a lot harder to read than if/then/fi.
> ...
> Does my reasoning make sense?
Not at all.  But ...
> I mean, the result will be exactly the same, we are clearly only
> talking about readability here.

... I agree, and I also think the "readability" is not absolute anyway.

FWIW, personally I'd find "if $completion_func does not yet exist and a way to dynload stuff exists, then use that way to load it from an external file" the most natural way to express what you are doing.

Previous: Florian GamböckNext: Florian Gamböck
Message 12 of 13 in “completion: Dynamic completion loading”
  1. 0/1 completion: Dynamic completion loadingFlorian Gamböck, Apr 8, 2018
  2. 1/1 completion: Load completion file for external subcommandFlorian Gamböck, Apr 8, 2018
  3. Florian GamböckApr 8, 2018
  4. Stefan BellerApr 9, 2018
  5. Florian GamböckApr 9, 2018
  6. SZEDER GáborApr 19, 2018
  7. 1/1 completion: load completion file for external subcommandFlorian Gamböck, Apr 8, 2018
  8. Junio C HamanoApr 8, 2018
  9. Florian GamböckApr 9, 2018
  10. Junio C HamanoApr 9, 2018
  11. Florian GamböckApr 9, 2018
  12. Junio C HamanoApr 9, 2018
  13. Florian GamböckApr 10, 2018

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.