aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-reset.txt
diff options
context:
space:
mode:
authorVictoria Dye <vdye@github.com>2022-03-15 01:49:39 +0000
committerJunio C Hamano <gitster@pobox.com>2022-03-14 18:51:56 -0700
commitfd56fba97f26bf668749207efd6a45aee2e2f57c (patch)
treee13d2c651f2e61f146d83cbafa209577ab4b0def /Documentation/git-reset.txt
parente86ec71d20d14861e4a3d047800d3ea3099c946d (diff)
downloadgit-fd56fba97f26bf668749207efd6a45aee2e2f57c.tar.gz
reset: introduce --[no-]refresh option to --mixed
Add a new --[no-]refresh option that is intended to explicitly determine whether a mixed reset should end in an index refresh. Starting at 9ac8125d1a (reset: don't compute unstaged changes after reset when --quiet, 2018-10-23), using the '--quiet' option results in skipping the call to 'refresh_index(...)' at the end of a mixed reset with the goal of improving performance. However, by coupling behavior that modifies the index with the option that silences logs, there is no way for users to have one without the other (i.e., silenced logs with a refreshed index) without incurring the overhead of a separate call to 'git update-index --refresh'. Furthermore, there is minimal user-facing documentation indicating that --quiet skips the index refresh, potentially leading to unexpected issues executing commands after 'git reset --quiet' that do not themselves refresh the index (e.g., internals of 'git stash', 'git read-tree'). To mitigate these issues, '--[no-]refresh' and 'reset.refresh' are introduced to provide a dedicated mechanism for refreshing the index. When either is set, '--quiet' and 'reset.quiet' revert to controlling only whether logs are silenced and do not affect index refresh. Helped-by: Derrick Stolee <derrickstolee@github.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-reset.txt')
-rw-r--r--Documentation/git-reset.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 6f7685f53d..89ddc85c2e 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -110,6 +110,15 @@ OPTIONS
`reset.quiet` config option. `--quiet` and `--no-quiet` will
override the default behavior.
+--refresh::
+--no-refresh::
+ 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, the default behavior is
+ decided by the `--[no-]quiet` option and/or `reset.quiet` config.
+ If `--quiet` is specified or `reset.quiet` is set with no command-line
+ "quiet" setting, refresh is disabled. Otherwise, refresh is enabled.
+
--pathspec-from-file=<file>::
Pathspec is passed in `<file>` instead of commandline args. If
`<file>` is exactly `-` then standard input is used. Pathspec