]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reset: replace '--quiet' with '--no-refresh' in performance advice
authorVictoria Dye <vdye@github.com>
Tue, 15 Mar 2022 01:49:40 +0000 (01:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Mar 2022 01:51:56 +0000 (18:51 -0700)
Replace references to '--quiet' with '--no-refresh' in the advice on how to
skip refreshing the index. When the advice was introduced, '--quiet' was the
only way to avoid the expensive 'refresh_index(...)' at the end of a mixed
reset. After introducing '--no-refresh', however, '--quiet' became only a
fallback option for determining refresh behavior, overridden by
'--[no-]refresh' or 'reset.refresh' if either is set. To ensure users are
advised to use the most reliable option for avoiding 'refresh_index(...)',
replace recommendation of '--quiet' with '--[no-]refresh'.

Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/advice.txt
advice.c
advice.h
builtin/reset.c

index 971aad2f237c4a4246f34e790400d87b34cf47c2..83c2a9566112583e460da11791af5881b482c1e8 100644 (file)
@@ -67,10 +67,10 @@ advice.*::
        commitBeforeMerge::
                Advice shown when linkgit:git-merge[1] refuses to
                merge to avoid overwriting local changes.
-       resetQuiet::
-               Advice to consider using the `--quiet` option to linkgit:git-reset[1]
-               when the command takes more than 2 seconds to refresh the index
-               after reset.
+       resetNoRefresh::
+               Advice to consider using the `--no-refresh` option to
+               linkgit:git-reset[1] when the command takes more than 2 seconds
+               to refresh the index after reset.
        resolveConflict::
                Advice shown by various commands when conflicts
                prevent the operation from being performed.
index 2e1fd483040bf399e3a689145d6c8dd3dfa277f5..cb755c551a283a09351fc9c3d31db675a9329b16 100644 (file)
--- a/advice.c
+++ b/advice.c
@@ -61,7 +61,7 @@ static struct {
        [ADVICE_PUSH_NON_FF_MATCHING]                   = { "pushNonFFMatching", 1 },
        [ADVICE_PUSH_UNQUALIFIED_REF_NAME]              = { "pushUnqualifiedRefName", 1 },
        [ADVICE_PUSH_UPDATE_REJECTED]                   = { "pushUpdateRejected", 1 },
-       [ADVICE_RESET_QUIET_WARNING]                    = { "resetQuiet", 1 },
+       [ADVICE_RESET_NO_REFRESH_WARNING]               = { "resetNoRefresh", 1 },
        [ADVICE_RESOLVE_CONFLICT]                       = { "resolveConflict", 1 },
        [ADVICE_RM_HINTS]                               = { "rmHints", 1 },
        [ADVICE_SEQUENCER_IN_USE]                       = { "sequencerInUse", 1 },
index a3957123a1618d02b1d8b8a3438dbd92a577523a..f95af70ced4214ea8afcd700a01c1e79f13c1785 100644 (file)
--- a/advice.h
+++ b/advice.h
@@ -36,7 +36,7 @@ struct string_list;
        ADVICE_PUSH_UPDATE_REJECTED_ALIAS,
        ADVICE_PUSH_UPDATE_REJECTED,
        ADVICE_PUSH_REF_NEEDS_UPDATE,
-       ADVICE_RESET_QUIET_WARNING,
+       ADVICE_RESET_NO_REFRESH_WARNING,
        ADVICE_RESOLVE_CONFLICT,
        ADVICE_RM_HINTS,
        ADVICE_SEQUENCER_IN_USE,
index 7f667e13d7186ed52b3249756552912262e8ca2b..feab85e03de152376471316f2a8068b0389e25e4 100644 (file)
@@ -535,10 +535,10 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
                                refresh_index(&the_index, flags, NULL, NULL,
                                              _("Unstaged changes after reset:"));
                                t_delta_in_ms = (getnanotime() - t_begin) / 1000000;
-                               if (advice_enabled(ADVICE_RESET_QUIET_WARNING) && t_delta_in_ms > REFRESH_INDEX_DELAY_WARNING_IN_MS) {
-                                       advise(_("It took %.2f seconds to refresh the index after reset.  You can\n"
-                                               "use '--quiet' to avoid this.  Set the config setting reset.quiet to true\n"
-                                               "to make this the default."), t_delta_in_ms / 1000.0);
+                               if (advice_enabled(ADVICE_RESET_NO_REFRESH_WARNING) && t_delta_in_ms > REFRESH_INDEX_DELAY_WARNING_IN_MS) {
+                                       advise(_("It took %.2f seconds to refresh the index after reset.  You can use\n"
+                                                "'--no-refresh' to avoid this.  Set the config setting reset.refresh to false\n"
+                                                "to make this the default."), t_delta_in_ms / 1000.0);
                                }
                        }
                } else {