{"thread":{"id":"56642","subject":"[PATCH 0/5] advice API: simplification, small fixes, readability","startedAt":"2021-10-04T01:58:30Z","lastAt":"2021-10-04T01:58:37Z","messageCount":6,"participants":["Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"437842","messageId":"cover-0.5-00000000000-20211004T015432Z-avarab@gmail.com","threadId":"56642","inReplyTo":null,"subject":"[PATCH 0/5] advice API: simplification, small fixes, readability","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-10-04T01:58:19Z","receivedAt":"2021-10-04T01:58:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"A follow-up to recent advice.[ch] improvements in fd0d7036e0d (Merge\nbranch 'ab/retire-advice-config', 2021-09-10). There are no in-flight\nadditions of new advice variables, and this doesn't conflict with\n\"seen\". So now seems like a good time to submit this.\n\nThe API carried some complexity due to needing to alias one of the\nvariables, which goes away in 3/5, 4/5 then further reduces\nboilerplate.\n\nÆvar Arnfjörð Bjarmason (5):\n  advice.h: don't indent top-level enum\n  advice output: emit empty lines as \"hint:\", not \"hint: \"\n  advice.[ch]: remove advice.pushNonFastForward alias\n  advice API: revamp the API, again\n  advice.[ch]: sort enum fields in alphabetical order\n\n advice.c                                    | 100 +++++++++-----------\n advice.h                                    |   5 +-\n contrib/mw-to-git/git-remote-mediawiki.perl |   2 +-\n t/t7004-tag.sh                              |   4 +-\n 4 files changed, 51 insertions(+), 60 deletions(-)\n\n-- \n2.33.0.1404.g7bcfc82b295\n\n"},{"id":"437843","messageId":"patch-2.5-5b5754ebfd2-20211004T015432Z-avarab@gmail.com","threadId":"56642","inReplyTo":"cover-0.5-00000000000-20211004T015432Z-avarab@gmail.com","subject":"[PATCH 2/5] advice output: emit empty lines as \"hint:\", not \"hint: \"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-10-04T01:58:21Z","receivedAt":"2021-10-04T01:58:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Let's not needlessly add this trailing whitespace to empty \"hint:\"\nlines, this makes copy/pasting them better, and also makes the tests\nmore straightforward.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n advice.c       | 9 +++++++--\n t/t7004-tag.sh | 4 ++--\n 2 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/advice.c b/advice.c\nindex 2f5499a5e18..9691c7e7899 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -90,10 +90,15 @@ static void vadvise(const char *advice, int display_instructions,\n \t\tstrbuf_addf(&buf, turn_off_instructions, key);\n \n \tfor (cp = buf.buf; *cp; cp = np) {\n+\t\tint len;\n+\n \t\tnp = strchrnul(cp, '\\n');\n-\t\tfprintf(stderr,\t_(\"%shint: %.*s%s\\n\"),\n+\t\tlen = np - cp;\n+\n+\t\tfprintf(stderr,\t_(\"%shint:%s%.*s%s\\n\"),\n \t\t\tadvise_get_color(ADVICE_COLOR_HINT),\n-\t\t\t(int)(np - cp), cp,\n+\t\t\tlen ? \" \" : \"\",\n+\t\t\tlen, cp,\n \t\t\tadvise_get_color(ADVICE_COLOR_RESET));\n \t\tif (*np)\n \t\t\tnp++;\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 082be85dffc..a7041e64ccf 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -1749,10 +1749,10 @@ test_expect_success '--points-at finds annotated tags of tags' '\n '\n \n test_expect_success 'recursive tagging should give advice' '\n-\tsed -e \"s/|$//\" <<-EOF >expect &&\n+\tcat <<-EOF >expect &&\n \thint: You have created a nested tag. The object referred to by your new tag is\n \thint: already a tag. If you meant to tag the object that it points to, use:\n-\thint: |\n+\thint:\n \thint: \tgit tag -f nested annotated-v4.0^{}\n \thint: Disable this message with \"git config advice.nestedTag false\"\n \tEOF\n-- \n2.33.0.1404.g7bcfc82b295\n\n"},{"id":"437844","messageId":"patch-1.5-80cc41ca194-20211004T015432Z-avarab@gmail.com","threadId":"56642","inReplyTo":"cover-0.5-00000000000-20211004T015432Z-avarab@gmail.com","subject":"[PATCH 1/5] advice.h: don't indent top-level enum","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-10-04T01:58:20Z","receivedAt":"2021-10-04T01:58:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Fix a style nit introduced in b3b18d16213 (advice: revamp advise API,\n2020-03-02) and remove the leading whitespace before \"enum\".\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n advice.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/advice.h b/advice.h\nindex 601265fd107..694219f5cb2 100644\n--- a/advice.h\n+++ b/advice.h\n@@ -12,7 +12,7 @@ struct string_list;\n  * Add the new config variable to Documentation/config/advice.txt.\n  * Call advise_if_enabled to print your advice.\n  */\n- enum advice_type {\n+enum advice_type {\n \tADVICE_ADD_EMBEDDED_REPO,\n \tADVICE_ADD_EMPTY_PATHSPEC,\n \tADVICE_ADD_IGNORED_FILE,\n-- \n2.33.0.1404.g7bcfc82b295\n\n"},{"id":"437845","messageId":"patch-3.5-00eaaeccbcb-20211004T015432Z-avarab@gmail.com","threadId":"56642","inReplyTo":"cover-0.5-00000000000-20211004T015432Z-avarab@gmail.com","subject":"[PATCH 3/5] advice.[ch]: remove advice.pushNonFastForward alias","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-10-04T01:58:22Z","receivedAt":"2021-10-04T01:58:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The advice.pushNonFastForward variable has been primarily known as\nadvice.pushUpdateRejected since 1184564eac8 (push: rename config\nvariable for more general use, 2012-12-02). It's been long enough by\nfar that we can declare this deprecation period over and remove it.\n\nThe only downside for users is going to be that they'll potentially\nsee a more verbose warning that they'll have to re-squash by changing\ntheir config, but that's hardly an undue burden.\n\nDoing this allows us to simplify the advice_enabled() function down to\nsomething truly trivial.\n\nChange the only in-tree user of this, it was added in\nfd47d7b94db (git-remote-mediawiki: obey advice.pushNonFastForward,\n2011-09-27), and not renamed in 1184564eac8 along with the rest.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n advice.c                                    | 12 +-----------\n advice.h                                    |  1 -\n contrib/mw-to-git/git-remote-mediawiki.perl |  2 +-\n 3 files changed, 2 insertions(+), 13 deletions(-)\n\ndiff --git a/advice.c b/advice.c\nindex 9691c7e7899..b395bc7d187 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -52,10 +52,6 @@ static struct {\n \t[ADVICE_PUSH_FETCH_FIRST]\t\t\t= { \"pushFetchFirst\", 1 },\n \t[ADVICE_PUSH_NEEDS_FORCE]\t\t\t= { \"pushNeedsForce\", 1 },\n \t[ADVICE_PUSH_REF_NEEDS_UPDATE]\t\t\t= { \"pushRefNeedsUpdate\", 1 },\n-\n-\t/* make this an alias for backward compatibility */\n-\t[ADVICE_PUSH_UPDATE_REJECTED_ALIAS]\t\t= { \"pushNonFastForward\", 1 },\n-\n \t[ADVICE_PUSH_NON_FF_CURRENT]\t\t\t= { \"pushNonFFCurrent\", 1 },\n \t[ADVICE_PUSH_NON_FF_MATCHING]\t\t\t= { \"pushNonFFMatching\", 1 },\n \t[ADVICE_PUSH_UNQUALIFIED_REF_NAME]\t\t= { \"pushUnqualifiedRefName\", 1 },\n@@ -116,13 +112,7 @@ void advise(const char *advice, ...)\n \n int advice_enabled(enum advice_type type)\n {\n-\tswitch(type) {\n-\tcase ADVICE_PUSH_UPDATE_REJECTED:\n-\t\treturn advice_setting[ADVICE_PUSH_UPDATE_REJECTED].enabled &&\n-\t\t       advice_setting[ADVICE_PUSH_UPDATE_REJECTED_ALIAS].enabled;\n-\tdefault:\n-\t\treturn advice_setting[type].enabled;\n-\t}\n+\treturn advice_setting[type].enabled;\n }\n \n void advise_if_enabled(enum advice_type type, const char *advice, ...)\ndiff --git a/advice.h b/advice.h\nindex 694219f5cb2..ab25c6ba9a0 100644\n--- a/advice.h\n+++ b/advice.h\n@@ -32,7 +32,6 @@ enum advice_type {\n \tADVICE_PUSH_NON_FF_CURRENT,\n \tADVICE_PUSH_NON_FF_MATCHING,\n \tADVICE_PUSH_UNQUALIFIED_REF_NAME,\n-\tADVICE_PUSH_UPDATE_REJECTED_ALIAS,\n \tADVICE_PUSH_UPDATE_REJECTED,\n \tADVICE_PUSH_REF_NEEDS_UPDATE,\n \tADVICE_RESET_QUIET_WARNING,\ndiff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl\nindex a5624413dc1..158e89e5048 100755\n--- a/contrib/mw-to-git/git-remote-mediawiki.perl\n+++ b/contrib/mw-to-git/git-remote-mediawiki.perl\n@@ -983,7 +983,7 @@ sub mw_import_revids {\n }\n \n sub error_non_fast_forward {\n-\tmy $advice = run_git_quoted([\"config\", \"--bool\", \"advice.pushNonFastForward\"]);\n+\tmy $advice = run_git_quoted([\"config\", \"--bool\", \"advice.pushUpdateRejected\"]);\n \tchomp($advice);\n \tif ($advice ne 'false') {\n \t\t# Native git-push would show this after the summary.\n-- \n2.33.0.1404.g7bcfc82b295\n\n"},{"id":"437846","messageId":"patch-4.5-25f6f5cd018-20211004T015432Z-avarab@gmail.com","threadId":"56642","inReplyTo":"cover-0.5-00000000000-20211004T015432Z-avarab@gmail.com","subject":"[PATCH 4/5] advice API: revamp the API, again","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-10-04T01:58:23Z","receivedAt":"2021-10-04T01:58:35Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Follow-up b3b18d16213 (advice: revamp advise API, 2020-03-02) and\nrevamp the declaration of the advice variables to:\n\n * Make it trivial to grep for them, by giving them the \"advice.\"\n   prefix explicitly, which also saves us from stripping it off\n   during config parsing.\n\n * All of the advice is enabled by default, so we can do this more\n   succinctly by having a \"disabled\" slot, instead of \"enabled\", and\n   then rely on the compiler to implicitly zero out the struct.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n advice.c | 81 +++++++++++++++++++++++++++-----------------------------\n 1 file changed, 39 insertions(+), 42 deletions(-)\n\ndiff --git a/advice.c b/advice.c\nindex b395bc7d187..f7cedac7549 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -33,46 +33,46 @@ static const char *advise_get_color(enum color_advice ix)\n \n static struct {\n \tconst char *key;\n-\tint enabled;\n+\tint disabled;\n } advice_setting[] = {\n-\t[ADVICE_ADD_EMBEDDED_REPO]\t\t\t= { \"addEmbeddedRepo\", 1 },\n-\t[ADVICE_ADD_EMPTY_PATHSPEC]\t\t\t= { \"addEmptyPathspec\", 1 },\n-\t[ADVICE_ADD_IGNORED_FILE]\t\t\t= { \"addIgnoredFile\", 1 },\n-\t[ADVICE_AM_WORK_DIR] \t\t\t\t= { \"amWorkDir\", 1 },\n-\t[ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME] \t= { \"checkoutAmbiguousRemoteBranchName\", 1 },\n-\t[ADVICE_COMMIT_BEFORE_MERGE]\t\t\t= { \"commitBeforeMerge\", 1 },\n-\t[ADVICE_DETACHED_HEAD]\t\t\t\t= { \"detachedHead\", 1 },\n-\t[ADVICE_FETCH_SHOW_FORCED_UPDATES]\t\t= { \"fetchShowForcedUpdates\", 1 },\n-\t[ADVICE_GRAFT_FILE_DEPRECATED]\t\t\t= { \"graftFileDeprecated\", 1 },\n-\t[ADVICE_IGNORED_HOOK]\t\t\t\t= { \"ignoredHook\", 1 },\n-\t[ADVICE_IMPLICIT_IDENTITY]\t\t\t= { \"implicitIdentity\", 1 },\n-\t[ADVICE_NESTED_TAG]\t\t\t\t= { \"nestedTag\", 1 },\n-\t[ADVICE_OBJECT_NAME_WARNING]\t\t\t= { \"objectNameWarning\", 1 },\n-\t[ADVICE_PUSH_ALREADY_EXISTS]\t\t\t= { \"pushAlreadyExists\", 1 },\n-\t[ADVICE_PUSH_FETCH_FIRST]\t\t\t= { \"pushFetchFirst\", 1 },\n-\t[ADVICE_PUSH_NEEDS_FORCE]\t\t\t= { \"pushNeedsForce\", 1 },\n-\t[ADVICE_PUSH_REF_NEEDS_UPDATE]\t\t\t= { \"pushRefNeedsUpdate\", 1 },\n-\t[ADVICE_PUSH_NON_FF_CURRENT]\t\t\t= { \"pushNonFFCurrent\", 1 },\n-\t[ADVICE_PUSH_NON_FF_MATCHING]\t\t\t= { \"pushNonFFMatching\", 1 },\n-\t[ADVICE_PUSH_UNQUALIFIED_REF_NAME]\t\t= { \"pushUnqualifiedRefName\", 1 },\n-\t[ADVICE_PUSH_UPDATE_REJECTED]\t\t\t= { \"pushUpdateRejected\", 1 },\n-\t[ADVICE_RESET_QUIET_WARNING]\t\t\t= { \"resetQuiet\", 1 },\n-\t[ADVICE_RESOLVE_CONFLICT]\t\t\t= { \"resolveConflict\", 1 },\n-\t[ADVICE_RM_HINTS]\t\t\t\t= { \"rmHints\", 1 },\n-\t[ADVICE_SEQUENCER_IN_USE]\t\t\t= { \"sequencerInUse\", 1 },\n-\t[ADVICE_SET_UPSTREAM_FAILURE]\t\t\t= { \"setUpstreamFailure\", 1 },\n-\t[ADVICE_SKIPPED_CHERRY_PICKS]\t\t\t= { \"skippedCherryPicks\", 1 },\n-\t[ADVICE_STATUS_AHEAD_BEHIND_WARNING]\t\t= { \"statusAheadBehindWarning\", 1 },\n-\t[ADVICE_STATUS_HINTS]\t\t\t\t= { \"statusHints\", 1 },\n-\t[ADVICE_STATUS_U_OPTION]\t\t\t= { \"statusUoption\", 1 },\n-\t[ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE] = { \"submoduleAlternateErrorStrategyDie\", 1 },\n-\t[ADVICE_UPDATE_SPARSE_PATH]\t\t\t= { \"updateSparsePath\", 1 },\n-\t[ADVICE_WAITING_FOR_EDITOR]\t\t\t= { \"waitingForEditor\", 1 },\n+\t[ADVICE_ADD_EMBEDDED_REPO]\t\t\t= { \"advice.addEmbeddedRepo\" },\n+\t[ADVICE_ADD_EMPTY_PATHSPEC]\t\t\t= { \"advice.addEmptyPathspec\" },\n+\t[ADVICE_ADD_IGNORED_FILE]\t\t\t= { \"advice.addIgnoredFile\" },\n+\t[ADVICE_AM_WORK_DIR] \t\t\t\t= { \"advice.amWorkDir\" },\n+\t[ADVICE_CHECKOUT_AMBIGUOUS_REMOTE_BRANCH_NAME] \t= { \"advice.checkoutAmbiguousRemoteBranchName\" },\n+\t[ADVICE_COMMIT_BEFORE_MERGE]\t\t\t= { \"advice.commitBeforeMerge\" },\n+\t[ADVICE_DETACHED_HEAD]\t\t\t\t= { \"advice.detachedHead\" },\n+\t[ADVICE_FETCH_SHOW_FORCED_UPDATES]\t\t= { \"advice.fetchShowForcedUpdates\" },\n+\t[ADVICE_GRAFT_FILE_DEPRECATED]\t\t\t= { \"advice.graftFileDeprecated\" },\n+\t[ADVICE_IGNORED_HOOK]\t\t\t\t= { \"advice.ignoredHook\" },\n+\t[ADVICE_IMPLICIT_IDENTITY]\t\t\t= { \"advice.implicitIdentity\" },\n+\t[ADVICE_NESTED_TAG]\t\t\t\t= { \"advice.nestedTag\" },\n+\t[ADVICE_OBJECT_NAME_WARNING]\t\t\t= { \"advice.objectNameWarning\" },\n+\t[ADVICE_PUSH_ALREADY_EXISTS]\t\t\t= { \"advice.pushAlreadyExists\" },\n+\t[ADVICE_PUSH_FETCH_FIRST]\t\t\t= { \"advice.pushFetchFirst\" },\n+\t[ADVICE_PUSH_NEEDS_FORCE]\t\t\t= { \"advice.pushNeedsForce\" },\n+\t[ADVICE_PUSH_REF_NEEDS_UPDATE]\t\t\t= { \"advice.pushRefNeedsUpdate\" },\n+\t[ADVICE_PUSH_NON_FF_CURRENT]\t\t\t= { \"advice.pushNonFFCurrent\" },\n+\t[ADVICE_PUSH_NON_FF_MATCHING]\t\t\t= { \"advice.pushNonFFMatching\" },\n+\t[ADVICE_PUSH_UNQUALIFIED_REF_NAME]\t\t= { \"advice.pushUnqualifiedRefName\" },\n+\t[ADVICE_PUSH_UPDATE_REJECTED]\t\t\t= { \"advice.pushUpdateRejected\" },\n+\t[ADVICE_RESET_QUIET_WARNING]\t\t\t= { \"advice.resetQuiet\" },\n+\t[ADVICE_RESOLVE_CONFLICT]\t\t\t= { \"advice.resolveConflict\" },\n+\t[ADVICE_RM_HINTS]\t\t\t\t= { \"advice.rmHints\" },\n+\t[ADVICE_SEQUENCER_IN_USE]\t\t\t= { \"advice.sequencerInUse\" },\n+\t[ADVICE_SET_UPSTREAM_FAILURE]\t\t\t= { \"advice.setUpstreamFailure\" },\n+\t[ADVICE_SKIPPED_CHERRY_PICKS]\t\t\t= { \"advice.skippedCherryPicks\" },\n+\t[ADVICE_STATUS_AHEAD_BEHIND_WARNING]\t\t= { \"advice.statusAheadBehindWarning\" },\n+\t[ADVICE_STATUS_HINTS]\t\t\t\t= { \"advice.statusHints\" },\n+\t[ADVICE_STATUS_U_OPTION]\t\t\t= { \"advice.statusUoption\" },\n+\t[ADVICE_SUBMODULE_ALTERNATE_ERROR_STRATEGY_DIE] = { \"advice.submoduleAlternateErrorStrategyDie\" },\n+\t[ADVICE_UPDATE_SPARSE_PATH]\t\t\t= { \"advice.updateSparsePath\" },\n+\t[ADVICE_WAITING_FOR_EDITOR]\t\t\t= { \"advice.waitingForEditor\" },\n };\n \n static const char turn_off_instructions[] =\n N_(\"\\n\"\n-   \"Disable this message with \\\"git config advice.%s false\\\"\");\n+   \"Disable this message with \\\"git config %s false\\\"\");\n \n static void vadvise(const char *advice, int display_instructions,\n \t\t    const char *key, va_list params)\n@@ -112,7 +112,7 @@ void advise(const char *advice, ...)\n \n int advice_enabled(enum advice_type type)\n {\n-\treturn advice_setting[type].enabled;\n+\treturn !advice_setting[type].disabled;\n }\n \n void advise_if_enabled(enum advice_type type, const char *advice, ...)\n@@ -129,7 +129,7 @@ void advise_if_enabled(enum advice_type type, const char *advice, ...)\n \n int git_default_advice_config(const char *var, const char *value)\n {\n-\tconst char *k, *slot_name;\n+\tconst char *slot_name;\n \tint i;\n \n \tif (!strcmp(var, \"color.advice\")) {\n@@ -146,13 +146,10 @@ int git_default_advice_config(const char *var, const char *value)\n \t\treturn color_parse(value, advice_colors[slot]);\n \t}\n \n-\tif (!skip_prefix(var, \"advice.\", &k))\n-\t\treturn 0;\n-\n \tfor (i = 0; i < ARRAY_SIZE(advice_setting); i++) {\n-\t\tif (strcasecmp(k, advice_setting[i].key))\n+\t\tif (strcasecmp(var, advice_setting[i].key))\n \t\t\tcontinue;\n-\t\tadvice_setting[i].enabled = git_config_bool(var, value);\n+\t\tadvice_setting[i].disabled = !git_config_bool(var, value);\n \t\treturn 0;\n \t}\n \n-- \n2.33.0.1404.g7bcfc82b295\n\n"},{"id":"437847","messageId":"patch-5.5-171153d421e-20211004T015432Z-avarab@gmail.com","threadId":"56642","inReplyTo":"cover-0.5-00000000000-20211004T015432Z-avarab@gmail.com","subject":"[PATCH 5/5] advice.[ch]: sort enum fields in alphabetical order","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-10-04T01:58:24Z","receivedAt":"2021-10-04T01:58:37Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"These fields have slightly drifted out of order, let's re-order them.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n advice.c | 2 +-\n advice.h | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/advice.c b/advice.c\nindex f7cedac7549..e0ee8ca4f2f 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -51,9 +51,9 @@ static struct {\n \t[ADVICE_PUSH_ALREADY_EXISTS]\t\t\t= { \"advice.pushAlreadyExists\" },\n \t[ADVICE_PUSH_FETCH_FIRST]\t\t\t= { \"advice.pushFetchFirst\" },\n \t[ADVICE_PUSH_NEEDS_FORCE]\t\t\t= { \"advice.pushNeedsForce\" },\n-\t[ADVICE_PUSH_REF_NEEDS_UPDATE]\t\t\t= { \"advice.pushRefNeedsUpdate\" },\n \t[ADVICE_PUSH_NON_FF_CURRENT]\t\t\t= { \"advice.pushNonFFCurrent\" },\n \t[ADVICE_PUSH_NON_FF_MATCHING]\t\t\t= { \"advice.pushNonFFMatching\" },\n+\t[ADVICE_PUSH_REF_NEEDS_UPDATE]\t\t\t= { \"advice.pushRefNeedsUpdate\" },\n \t[ADVICE_PUSH_UNQUALIFIED_REF_NAME]\t\t= { \"advice.pushUnqualifiedRefName\" },\n \t[ADVICE_PUSH_UPDATE_REJECTED]\t\t\t= { \"advice.pushUpdateRejected\" },\n \t[ADVICE_RESET_QUIET_WARNING]\t\t\t= { \"advice.resetQuiet\" },\ndiff --git a/advice.h b/advice.h\nindex ab25c6ba9a0..a6aca9684c7 100644\n--- a/advice.h\n+++ b/advice.h\n@@ -31,9 +31,9 @@ enum advice_type {\n \tADVICE_PUSH_NEEDS_FORCE,\n \tADVICE_PUSH_NON_FF_CURRENT,\n \tADVICE_PUSH_NON_FF_MATCHING,\n+\tADVICE_PUSH_REF_NEEDS_UPDATE,\n \tADVICE_PUSH_UNQUALIFIED_REF_NAME,\n \tADVICE_PUSH_UPDATE_REJECTED,\n-\tADVICE_PUSH_REF_NEEDS_UPDATE,\n \tADVICE_RESET_QUIET_WARNING,\n \tADVICE_RESOLVE_CONFLICT,\n \tADVICE_RM_HINTS,\n-- \n2.33.0.1404.g7bcfc82b295\n\n"}]}