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

Re: [PATCH/RFC 0/2] Automate updating git-completion.bash a bit

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jan 22, 2018, 18:03 UTC
Message-ID
<CAM0VKj=NeQ_BthG087vswP=mCizXPBcfmCAa9haH4N5MRCNRWQ@mail.gmail.com>
In-Reply-To
<20180117093432.GA19189@ash>
On Wed, Jan 17, 2018 at 10:34 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 8 quoted lines
> Actually I forgot another option. What if we automate updating the
> script at "compile" time instead of calling git at run time? E.g. with
> something like below, a contributor could just run
>
>     make update-completion
>
> then add git-completion.bash changes to the same patch that introduces
> new options. If they forget

They inevitably will :) If contributors have to remember something anyway, then they might as well remember to update the completion script in the first place.

Another alternative would be to extend t9902 with (preferably auto-generated) tests to compare the output of 'git $cmd --git-completion-helper' with 'run_completion "git $cmd --"'. Then contributors wouldn't have to remember anything, because everyone runs the full test suite every time anyway, right?

However, that would result in some code churn initially, because I suspect the options are listed in different order in the command and in the completion script.

All in all I don't think it would trump getting all --options straight from the commands themselves.

Previous: Duy NguyenNext: Duy Nguyen
Message 11 of 14 in “Automate updating git-completion.bash a bit”
  1. 0/2 Automate updating git-completion.bash a bitNguyễn Thái Ngọc Duy, Jan 16, 2018
  2. 1/2 parse-options: support --git-completion-helperNguyễn Thái Ngọc Duy, Jan 16, 2018
  3. Jacob KellerJan 16, 2018
  4. Duy NguyenJan 17, 2018
  5. Junio C HamanoJan 16, 2018
  6. Duy NguyenJan 17, 2018
  7. 2/2 git-completion: use --git-completion-helperNguyễn Thái Ngọc Duy, Jan 16, 2018
  8. SZEDER GáborJan 17, 2018
  9. Duy NguyenJan 17, 2018
  10. Duy NguyenJan 17, 2018
  11. SZEDER GáborJan 22, 2018
  12. Duy NguyenJan 23, 2018
  13. Duy NguyenApr 11, 2019
  14. Duy NguyenApr 11, 2019

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.