git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Victoria Dye via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, phillip.wood123@gmail.com,
	Victoria Dye <vdye@github.com>
Subject: [PATCH v2 0/3] reset: make --no-refresh the only way to skip index refresh
Date: Wed, 23 Mar 2022 18:17:57 +0000	[thread overview]
Message-ID: <pull.1184.v2.git.1648059480.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1184.git.1647894889.gitgitgadget@gmail.com>

Maintainer's note: this is based on vd/stash-silence-reset (specifically,
4b8b0f6fa2 (stash: make internal resets quiet and refresh index,
2022-03-15)).

----------------------------------------------------------------------------

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 removes all methods of skipping index refresh in
'git reset --mixed' except for '--no-refresh' itself:

 * Patch [1/3] 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/3] removes 'reset.quiet', since its main use was to disable
   index refresh until that behavior was removed in [1/3].
 * Patch [3/3] removes '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.


Changes since V1
================

 * Dropped patch that removed '--refresh', again allowing both
   '--no-refresh' and '--refresh' as valid options.
 * Updated documentation of "--refresh" option to remove unnecessary
   "proactively".
 * Reworded commit titles to change "deprecate" to the more accurate
   "remove".

[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 (3):
  reset: do not make '--quiet' disable index refresh
  reset: remove 'reset.quiet' config option
  reset: remove 'reset.refresh' config option

 Documentation/config.txt       |  2 --
 Documentation/config/reset.txt |  2 --
 Documentation/git-reset.txt    | 12 ++-------
 builtin/reset.c                | 14 ++---------
 contrib/scalar/scalar.c        |  1 -
 t/t7102-reset.sh               | 45 +++++-----------------------------
 6 files changed, 10 insertions(+), 66 deletions(-)
 delete mode 100644 Documentation/config/reset.txt


base-commit: 877d90220e42b40cf5b899dc36a13c348220b54c
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1184%2Fvdye%2Freset%2Fclean-up-refresh-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1184/vdye/reset/clean-up-refresh-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1184

Range-diff vs v1:

 1:  f89e9b4ae24 ! 1:  1b607e0610b reset: do not make '--quiet' disable index refresh
     @@ Commit message
          behavior from '--quiet' because it is completely unrelated to the stated
          purpose of the option: "Be quiet, only report errors."
      
     +    Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
          Signed-off-by: Victoria Dye <vdye@github.com>
      
       ## Documentation/git-reset.txt ##
     @@ Documentation/git-reset.txt: OPTIONS
       	Pathspec is passed in `<file>` instead of commandline args. If
      
       ## builtin/reset.c ##
     +@@ builtin/reset.c: static int git_reset_config(const char *var, const char *value, void *cb)
     + int cmd_reset(int argc, const char **argv, const char *prefix)
     + {
     + 	int reset_type = NONE, update_ref_status = 0, quiet = 0;
     +-	int refresh = -1;
     ++	int refresh = 1;
     + 	int patch_mode = 0, pathspec_file_nul = 0, unborn;
     + 	const char *rev, *pathspec_from_file = NULL;
     + 	struct object_id oid;
      @@ builtin/reset.c: int cmd_reset(int argc, const char **argv, const char *prefix)
       						PARSE_OPT_KEEP_DASHDASH);
       	parse_args(&pathspec, argv, prefix, patch_mode, &rev);
 2:  d9bebd4b4e0 ! 2:  a25aff3ac7c reset: deprecate 'reset.quiet' config option
     @@ Metadata
      Author: Victoria Dye <vdye@github.com>
      
       ## Commit message ##
     -    reset: deprecate 'reset.quiet' config option
     +    reset: remove 'reset.quiet' config option
      
          Remove the 'reset.quiet' config option, remove '--no-quiet' documentation in
          'Documentation/git-reset.txt'. In 4c3abd0551 (reset: add new reset.quiet
 3:  ecd3296fd25 ! 3:  597aa82851c reset: deprecate 'reset.refresh' config option
     @@ Metadata
      Author: Victoria Dye <vdye@github.com>
      
       ## Commit message ##
     -    reset: deprecate 'reset.refresh' config option
     +    reset: remove 'reset.refresh' config option
      
          Remove the 'reset.refresh' option, requiring that users explicitly specify
          '--no-refresh' if they want to skip refreshing the index.
     @@ Documentation/git-reset.txt: OPTIONS
      -	Proactively refresh the index after a mixed reset. If unspecified, the
      -	behavior falls back on the `reset.refresh` config option. If neither
      -	`--[no-]refresh` nor `reset.refresh` are set, refresh is enabled.
     -+	Proactively refresh the index after a mixed reset. Enabled by default.
     ++	Refresh the index after a mixed reset. Enabled by default.
       
       --pathspec-from-file=<file>::
       	Pathspec is passed in `<file>` instead of commandline args. If
 4:  dbb63c4caa8 < -:  ----------- reset: deprecate '--refresh', leaving only '--no-refresh'

-- 
gitgitgadget

  parent reply	other threads:[~2022-03-23 18:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 20:34 [PATCH 0/4] reset: make --no-refresh the only way to skip index refresh Victoria Dye via GitGitGadget
2022-03-21 20:34 ` [PATCH 1/4] reset: do not make '--quiet' disable " Victoria Dye via GitGitGadget
2022-03-23 15:59   ` Phillip Wood
2022-03-23 16:52     ` Victoria Dye
2022-03-21 20:34 ` [PATCH 2/4] reset: deprecate 'reset.quiet' config option Victoria Dye via GitGitGadget
2022-03-23 16:00   ` Phillip Wood
2022-03-21 20:34 ` [PATCH 3/4] reset: deprecate 'reset.refresh' " Victoria Dye via GitGitGadget
2022-03-23 16:02   ` Phillip Wood
2022-03-23 17:19     ` Victoria Dye
2022-03-21 20:34 ` [PATCH 4/4] reset: deprecate '--refresh', leaving only '--no-refresh' Victoria Dye via GitGitGadget
2022-03-23 16:02   ` Phillip Wood
2022-03-23 16:58     ` Victoria Dye
2022-03-23 18:17 ` Victoria Dye via GitGitGadget [this message]
2022-03-23 18:17   ` [PATCH v2 1/3] reset: do not make '--quiet' disable index refresh Victoria Dye via GitGitGadget
2022-03-23 18:17   ` [PATCH v2 2/3] reset: remove 'reset.quiet' config option Victoria Dye via GitGitGadget
2022-03-23 18:18   ` [PATCH v2 3/3] reset: remove 'reset.refresh' " Victoria Dye via GitGitGadget
2022-03-23 19:26   ` [PATCH v2 0/3] reset: make --no-refresh the only way to skip index refresh Derrick Stolee
2022-03-23 21:41   ` Junio C Hamano
2022-03-24 11:11   ` Phillip Wood
2022-03-24 17:13     ` Junio C Hamano
2022-03-24 17:33       ` Junio C Hamano
2022-03-24 18:01         ` Victoria Dye
2022-03-24 20:36           ` Junio C Hamano
2022-03-25 15:04         ` Derrick Stolee
2022-03-25 16:35           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1184.v2.git.1648059480.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood123@gmail.com \
    --cc=vdye@github.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).