Merge branch 'dl/complete-cherry-pick-revert-skip'
[gitweb.git] / builtin / commit.c
index 71305073ad49bf607bddc18393722dafbfa6a777..ae7aaf6dc6835888e4fb55de8a135331ab05316e 100644 (file)
@@ -60,15 +60,18 @@ N_("The previous cherry-pick is now empty, possibly due to conflict resolution.\
 "\n");
 
 static const char empty_cherry_pick_advice_single[] =
-N_("Otherwise, please use 'git reset'\n");
+N_("Otherwise, please use 'git cherry-pick --skip'\n");
 
 static const char empty_cherry_pick_advice_multi[] =
-N_("If you wish to skip this commit, use:\n"
+N_("and then use:\n"
 "\n"
-"    git reset\n"
+"    git cherry-pick --continue\n"
 "\n"
-"Then \"git cherry-pick --continue\" will resume cherry-picking\n"
-"the remaining commits.\n");
+"to resume cherry-picking the remaining commits.\n"
+"If you wish to skip this commit, use:\n"
+"\n"
+"    git cherry-pick --skip\n"
+"\n");
 
 static const char *color_status_slots[] = {
        [WT_STATUS_HEADER]        = "header",
@@ -1111,11 +1114,13 @@ static void finalize_deferred_config(struct wt_status *s)
 
        /*
         * If the user did not give a "--[no]-ahead-behind" command
-        * line argument, then we inherit the a/b config setting.
-        * If is not set, then we inherit _FULL for backwards
-        * compatibility.
+        * line argument *AND* we will print in a human-readable format
+        * (short, long etc.) then we inherit from the status.aheadbehind
+        * config setting.  In all other cases (and porcelain V[12] formats
+        * in particular), we inherit _FULL for backwards compatibility.
         */
-       if (s->ahead_behind_flags == AHEAD_BEHIND_UNSPECIFIED)
+       if (use_deferred_config &&
+           s->ahead_behind_flags == AHEAD_BEHIND_UNSPECIFIED)
                s->ahead_behind_flags = status_deferred_config.ahead_behind;
 
        if (s->ahead_behind_flags == AHEAD_BEHIND_UNSPECIFIED)
@@ -1673,7 +1678,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
                die("%s", err.buf);
        }
 
-       sequencer_post_commit_cleanup(the_repository);
+       sequencer_post_commit_cleanup(the_repository, 0);
        unlink(git_path_merge_head(the_repository));
        unlink(git_path_merge_msg(the_repository));
        unlink(git_path_merge_mode(the_repository));
@@ -1682,10 +1687,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
        if (commit_index_files())
                die(_("repository has been updated, but unable to write\n"
                      "new_index file. Check that disk is not full and quota is\n"
-                     "not exceeded, and then \"git reset HEAD\" to recover."));
+                     "not exceeded, and then \"git restore --staged :/\" to recover."));
 
-       if (git_env_bool(GIT_TEST_COMMIT_GRAPH, 0))
-               write_commit_graph_reachable(get_object_directory(), 0, 0);
+       if (git_env_bool(GIT_TEST_COMMIT_GRAPH, 0) &&
+           write_commit_graph_reachable(get_object_directory(), 0, NULL))
+               return 1;
 
        repo_rerere(the_repository, 0);
        run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);