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

Re: [PATCH v2 0/3] reset: make --no-refresh the only way to skip index refresh

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2022, 17:13 UTC
Message-ID
<xmqqsfr7jmtb.fsf@gitster.g>
In-Reply-To
<6d424915-5c63-bebd-f3b5-f153a541d077@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 5 quoted lines
> I should have been clearer in my comments that I think changing the
> option name no '--no-refresh' whilst retaining '--refresh' is 
> worthwhile. '--no-refresh' is the form that users will want most of
> the time and changing the option name means that the useful version
> will be shown by "reset -h".

I am OK with it shown as "--[no-]refresh" or even "--refresh" alone, as long as the description describes the "refresh" behaviour and makes it clear that it is the default, with the expectation that the users know from other boolean options that "--option" listed in "-h" would naturally take "--no-option".

But as posted, 
    $ rungit seen reset -h 2>&1 | grep refresh
        --refresh             skip refreshing the index after reset

the explanation given is for "--no-refresh" (which is wrong), so we'd need some fix in the area. We could rephrase it to read

        --refresh             refresh the index after reset (default)

but as you suggested, I think mimicking how existing commands with "--no-<option>" are shown, e.g. builtlin/update-ref.c does "--no-deref",

    $ git update-ref -h 2>&1 | grep deref
        --no-deref            update <refname> not the one it points to
    $ git grep 'OPT_BOOL.*"no-deref"'
    builtin/update-ref.c:		OPT_BOOL( 0 , "no-deref", &no_deref,
would be a good approach.
> The range-diff for the other changes looks good
Thanks.

#leftoverbit: we may want to discuss if it is a good idea to teach OPT_BOOL() to list "--[no-]<option>" in "git cmd -h", instead of just "--<option>".

Previous: Phillip WoodNext: Junio C Hamano
Message 20 of 25 in “reset: make --no-refresh the only way to skip index refresh”
  1. 0/4 reset: make --no-refresh the only way to skip index refreshVictoria Dye via GitGitGadget, Mar 21, 2022
  2. 2/4 reset: deprecate 'reset.quiet' config optionVictoria Dye via GitGitGadget, Mar 21, 2022
  3. Phillip WoodMar 23, 2022
  4. 1/4 reset: do not make '--quiet' disable index refreshVictoria Dye via GitGitGadget, Mar 21, 2022
  5. Phillip WoodMar 23, 2022
  6. Victoria DyeMar 23, 2022
  7. 3/4 reset: deprecate 'reset.refresh' config optionVictoria Dye via GitGitGadget, Mar 21, 2022
  8. Phillip WoodMar 23, 2022
  9. Victoria DyeMar 23, 2022
  10. 4/4 reset: deprecate '--refresh', leaving only '--no-refresh'Victoria Dye via GitGitGadget, Mar 21, 2022
  11. Phillip WoodMar 23, 2022
  12. Victoria DyeMar 23, 2022
  13. 0/3 reset: make --no-refresh the only way to skip index refreshVictoria Dye via GitGitGadget, Mar 23, 2022
  14. 1/3 reset: do not make '--quiet' disable index refreshVictoria Dye via GitGitGadget, Mar 23, 2022
  15. 2/3 reset: remove 'reset.quiet' config optionVictoria Dye via GitGitGadget, Mar 23, 2022
  16. 3/3 reset: remove 'reset.refresh' config optionVictoria Dye via GitGitGadget, Mar 23, 2022
  17. Derrick StoleeMar 23, 2022
  18. Junio C HamanoMar 23, 2022
  19. Phillip WoodMar 24, 2022
  20. Junio C HamanoMar 24, 2022
  21. Junio C HamanoMar 24, 2022
  22. Victoria DyeMar 24, 2022
  23. Junio C HamanoMar 24, 2022
  24. Derrick StoleeMar 25, 2022
  25. Junio C HamanoMar 25, 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.