checkout.c: unstage empty deleted ita files
[gitweb.git] / advice.c
index ce5f374ecd4917346145c8a380ac8c0e45e849a4..3ee0ee2d8fbb04dabcfc0152dc741c7d1f28b220 100644 (file)
--- a/advice.c
+++ b/advice.c
@@ -3,6 +3,7 @@
 #include "color.h"
 #include "help.h"
 
+int advice_fetch_show_forced_updates = 1;
 int advice_push_update_rejected = 1;
 int advice_push_non_ff_current = 1;
 int advice_push_non_ff_matching = 1;
@@ -12,9 +13,11 @@ int advice_push_needs_force = 1;
 int advice_push_unqualified_ref_name = 1;
 int advice_status_hints = 1;
 int advice_status_u_option = 1;
+int advice_status_ahead_behind_warning = 1;
 int advice_commit_before_merge = 1;
 int advice_reset_quiet_warning = 1;
 int advice_resolve_conflict = 1;
+int advice_sequencer_in_use = 1;
 int advice_implicit_identity = 1;
 int advice_detached_head = 1;
 int advice_set_upstream_failure = 1;
@@ -59,6 +62,7 @@ static struct {
        const char *name;
        int *preference;
 } advice_config[] = {
+       { "fetchShowForcedUpdates", &advice_fetch_show_forced_updates },
        { "pushUpdateRejected", &advice_push_update_rejected },
        { "pushNonFFCurrent", &advice_push_non_ff_current },
        { "pushNonFFMatching", &advice_push_non_ff_matching },
@@ -68,9 +72,11 @@ static struct {
        { "pushUnqualifiedRefName", &advice_push_unqualified_ref_name },
        { "statusHints", &advice_status_hints },
        { "statusUoption", &advice_status_u_option },
+       { "statusAheadBehindWarning", &advice_status_ahead_behind_warning },
        { "commitBeforeMerge", &advice_commit_before_merge },
        { "resetQuiet", &advice_reset_quiet_warning },
        { "resolveConflict", &advice_resolve_conflict },
+       { "sequencerInUse", &advice_sequencer_in_use },
        { "implicitIdentity", &advice_implicit_identity },
        { "detachedHead", &advice_detached_head },
        { "setupStreamFailure", &advice_set_upstream_failure },
@@ -193,13 +199,22 @@ void NORETURN die_conclude_merge(void)
 void detach_advice(const char *new_name)
 {
        const char *fmt =
-       _("Note: checking out '%s'.\n\n"
+       _("Note: switching to '%s'.\n"
+       "\n"
        "You are in 'detached HEAD' state. You can look around, make experimental\n"
        "changes and commit them, and you can discard any commits you make in this\n"
-       "state without impacting any branches by performing another checkout.\n\n"
+       "state without impacting any branches by switching back to a branch.\n"
+       "\n"
        "If you want to create a new branch to retain commits you create, you may\n"
-       "do so (now or later) by using -b with the checkout command again. Example:\n\n"
-       "  git checkout -b <new-branch-name>\n\n");
+       "do so (now or later) by using -c with the switch command. Example:\n"
+       "\n"
+       "  git switch -c <new-branch-name>\n"
+       "\n"
+       "Or undo this operation with:\n"
+       "\n"
+       "  git switch -\n"
+       "\n"
+       "Turn off this advice by setting config variable advice.detachedHead to false\n\n");
 
        fprintf(stderr, fmt, new_name);
 }