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

Re: [PATCH v3 2/5] reset: introduce --[no-]refresh option to --mixed

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 18, 2022, 17:17 UTC
Message-ID
<xmqqy2179o3c.fsf@gitster.g>
In-Reply-To
<80a5f411-2ddb-177f-4139-1dfff436deda@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 13 quoted lines
> This keeps the current behavior of not refreshing when --quiet is
> given. I wonder how disruptive it would be to take the opportunity to
> get rid of that hack and go back the the original behavior of
> refreshing when --quiet is given. There are a couple of assumptions
> that make me think it might be acceptable
>
> 1 - anyone using a sparse index wont notice as refreshing the index
>     should be fast for them
>
> 2 - the large repositories that are affected exist in managed
>     environments where an admin who reads the release notes could set
>     reset.refresh in a central config so individual users are not
>     inconvenienced.

I would very much prefer to see "--quiet" not making contribution to the decision to refresh or not in the longer term. Many plumbing commands expect that the calling scripts refresh the index with an explicit use of "update-index --refresh" and leave the index not refreshed, but working on unrefreshed index is a trade-off between performance and correctness.

 * Turning "--quiet" not to refresh may incur performance regression
   for shorter term.  It will not hurt correctness.
 * Introducing "--no-refresh" to mark "reset --quiet" invocations,
   where the freshness of the index does not matter for correctness,
   would help regain performance without breaking scripts.  All
   "reset --quiet" invocations in scripts written before this series
   are supposed to be safe (as they lived with their "reset --quiet"
   that does not refresh), but newly written scripts may start
   expecting that "reset --quiet" would refresh for correctness.
 * If we allow reset.refresh to be set to "no", however, that would
   affect _all_ uses of "reset --quiet", including the ones in newly
   written scripts that expect "reset --quiet" to refresh.  They
   would be forced to say "reset --quiet --refresh", just in case
   the user has such a configuration; otherwise these scripts will
   be declared "buggy" for not explicitly saying "--refresh".

I do not think reset.refresh is a good idea, but I very much like the idea to making "reset" (regardless of "--quiet") to refresh by default.

Thanks.
Previous: Phillip WoodNext: Victoria Dye
Message 33 of 39 in “Separate '--skip-refresh' from '--quiet' in 'reset', use '--quiet' internally in 'stash'”
  1. 0/5 Separate '--skip-refresh' from '--quiet' in 'reset', use '--quiet' internally in 'stash'Victoria Dye via GitGitGadget, Mar 12, 2022
  2. 1/5 reset: revise index refresh adviceVictoria Dye via GitGitGadget, Mar 12, 2022
  3. 2/5 reset: introduce --[no-]refresh option to --mixedVictoria Dye via GitGitGadget, Mar 12, 2022
  4. Derrick StoleeMar 14, 2022
  5. Derrick StoleeMar 14, 2022
  6. Victoria DyeMar 14, 2022
  7. 3/5 reset: replace '--quiet' with '--no-refresh' in performance adviceVictoria Dye via GitGitGadget, Mar 12, 2022
  8. 4/5 reset: suppress '--no-refresh' advice if logging is silencedVictoria Dye via GitGitGadget, Mar 12, 2022
  9. 5/5 stash: make internal resets quiet and refresh indexVictoria Dye via GitGitGadget, Mar 12, 2022
  10. Derrick StoleeMar 14, 2022
  11. Victoria DyeMar 14, 2022
  12. Victoria DyeMar 12, 2022
  13. Junio C HamanoMar 14, 2022
  14. Derrick StoleeMar 14, 2022
  15. 0/5 Allow 'reset --quiet' to refresh the index, use 'reset --quiet' in 'stash'Victoria Dye via GitGitGadget, Mar 14, 2022
  16. 2/5 reset: introduce --[no-]refresh option to --mixedVictoria Dye via GitGitGadget, Mar 14, 2022
  17. Junio C HamanoMar 14, 2022
  18. Victoria DyeMar 14, 2022
  19. 1/5 reset: revise index refresh adviceVictoria Dye via GitGitGadget, Mar 14, 2022
  20. 4/5 reset: suppress '--no-refresh' advice if logging is silencedVictoria Dye via GitGitGadget, Mar 14, 2022
  21. Junio C HamanoMar 14, 2022
  22. 3/5 reset: replace '--quiet' with '--no-refresh' in performance adviceVictoria Dye via GitGitGadget, Mar 14, 2022
  23. 5/5 stash: make internal resets quiet and refresh indexVictoria Dye via GitGitGadget, Mar 14, 2022
  24. Junio C HamanoMar 14, 2022
  25. Victoria DyeMar 14, 2022
  26. Derrick StoleeMar 14, 2022
  27. Junio C HamanoMar 14, 2022
  28. 0/5 Allow 'reset --quiet' to refresh the index, use 'reset --quiet' in 'stash'Victoria Dye via GitGitGadget, Mar 15, 2022
  29. 1/5 reset: revise index refresh adviceVictoria Dye via GitGitGadget, Mar 15, 2022
  30. 3/5 reset: replace '--quiet' with '--no-refresh' in performance adviceVictoria Dye via GitGitGadget, Mar 15, 2022
  31. 2/5 reset: introduce --[no-]refresh option to --mixedVictoria Dye via GitGitGadget, Mar 15, 2022
  32. Phillip WoodMar 18, 2022
  33. Junio C HamanoMar 18, 2022
  34. Victoria DyeMar 18, 2022
  35. 4/5 reset: suppress '--no-refresh' advice if logging is silencedVictoria Dye via GitGitGadget, Mar 15, 2022
  36. 5/5 stash: make internal resets quiet and refresh indexVictoria Dye via GitGitGadget, Mar 15, 2022
  37. Junio C HamanoMar 15, 2022
  38. Victoria DyeMar 16, 2022
  39. Junio C HamanoMar 16, 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.