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

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

From
Victoria Dye via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 21, 2022, 20:34 UTC
Message-ID
<pull.1184.git.1647894889.gitgitgadget@gmail.com>
Maintainer's note: this is based on vd/stash-silence-reset
----------------------------------------------------------------------------

This is a follow-up to the changes in vd/stash-silence-reset [1], in which index refreshing behavior was decoupled from log silencing in the '--quiet' option to 'git reset --mixed' by introducing a '--[no-]refresh' option and 'reset.refresh' config setting.

After some discussion [2] on the mailing list, both the backward-compatibility and use of global options in that series came into question:

 * '--quiet' still skipped refresh if neither '--[no-]refresh' nor
   'reset.refresh' were specified, meaning that users could still be left
   with an incorrect index state after reset.
 * Having 'reset.quiet' and/or 'reset.refresh' potentially disable index
   refresh by default meant that developers would need to defensively add
   '--refresh' to all internal uses of 'git reset --mixed'. Without that
   option, different config setups could cause variability in index
   correctness from user to user.

In response, this series deprecates all instances of skipping index refresh in 'git reset --mixed' except for '--no-refresh' itself:

 * Patch [1/4] removes the "fallback" behavior of 'reset.quiet' and
   '--quiet' implying '--no-refresh' if neither '--[no-]refresh' nor
   'config.refresh' were specified. In other words, '--quiet' no longer does
   anything other than log silencing.
 * Patch [2/4] deprecates 'reset.quiet', since its main use was to disable
   index refresh until it was deprecated in [1/4].
 * Patch [3/4] deprecates 'reset.refresh' to avoid users accidentally ending
   up with an incorrect index state after all resets as a result of a global
   setting's passive effects.
 * Patch [4/4] removes the '--refresh' option, leaving only '--no-refresh'.
   Because nothing but '--no-refresh' can skip the 'reset' index refresh
   anymore, '--refresh' would never be needed.

[1] https://lore.kernel.org/git/pull.1170.v3.git.1647308982.gitgitgadget@gmail.com/ [2] https://lore.kernel.org/git/80a2a5a2-256f-6c3b-2430-10bef99ce1e9@github.com/

Thanks! -Victoria
Victoria Dye (4):
  reset: do not make '--quiet' disable index refresh
  reset: deprecate 'reset.quiet' config option
  reset: deprecate 'reset.refresh' config option
  reset: deprecate '--refresh', leaving only '--no-refresh'
 Documentation/config.txt       |  2 --
 Documentation/config/reset.txt |  2 --
 Documentation/git-reset.txt    | 13 ++-------
 builtin/reset.c                | 18 +++----------
 builtin/stash.c                |  4 +--
 contrib/scalar/scalar.c        |  1 -
 t/t7102-reset.sh               | 48 +++++-----------------------------
 7 files changed, 15 insertions(+), 73 deletions(-)
 delete mode 100644 Documentation/config/reset.txt
base-commit: 4b8b0f6fa2778c1f9c373620e3f07787543914c6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1184%2Fvdye%2Freset%2Fclean-up-refresh-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1184/vdye/reset/clean-up-refresh-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1184
-- 
gitgitgadget
Next: Victoria Dye via GitGitGadget
Message 1 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.