@@ -479,7 +479,7 @@ static void print_advice(struct repository *r, int show_hint,
479479 msg = getenv ("GIT_CHERRY_PICK_HELP" );
480480
481481 if (msg ) {
482- advise ( "%s\n " , msg );
482+ advise_if_enabled ( ADVICE_MERGE_CONFLICT , "%s" , msg );
483483 /*
484484 * A conflict has occurred but the porcelain
485485 * (typically rebase --interactive) wants to take care
@@ -492,22 +492,25 @@ static void print_advice(struct repository *r, int show_hint,
492492
493493 if (show_hint ) {
494494 if (opts -> no_commit )
495- advise (_ ("after resolving the conflicts, mark the corrected paths\n"
496- "with 'git add <paths>' or 'git rm <paths>'" ));
495+ advise_if_enabled (ADVICE_MERGE_CONFLICT ,
496+ _ ("after resolving the conflicts, mark the corrected paths\n"
497+ "with 'git add <paths>' or 'git rm <paths>'" ));
497498 else if (opts -> action == REPLAY_PICK )
498- advise (_ ("After resolving the conflicts, mark them with\n"
499- "\"git add/rm <pathspec>\", then run\n"
500- "\"git cherry-pick --continue\".\n"
501- "You can instead skip this commit with \"git cherry-pick --skip\".\n"
502- "To abort and get back to the state before \"git cherry-pick\",\n"
503- "run \"git cherry-pick --abort\"." ));
499+ advise_if_enabled (ADVICE_MERGE_CONFLICT ,
500+ _ ("After resolving the conflicts, mark them with\n"
501+ "\"git add/rm <pathspec>\", then run\n"
502+ "\"git cherry-pick --continue\".\n"
503+ "You can instead skip this commit with \"git cherry-pick --skip\".\n"
504+ "To abort and get back to the state before \"git cherry-pick\",\n"
505+ "run \"git cherry-pick --abort\"." ));
504506 else if (opts -> action == REPLAY_REVERT )
505- advise (_ ("After resolving the conflicts, mark them with\n"
506- "\"git add/rm <pathspec>\", then run\n"
507- "\"git revert --continue\".\n"
508- "You can instead skip this commit with \"git revert --skip\".\n"
509- "To abort and get back to the state before \"git revert\",\n"
510- "run \"git revert --abort\"." ));
507+ advise_if_enabled (ADVICE_MERGE_CONFLICT ,
508+ _ ("After resolving the conflicts, mark them with\n"
509+ "\"git add/rm <pathspec>\", then run\n"
510+ "\"git revert --continue\".\n"
511+ "You can instead skip this commit with \"git revert --skip\".\n"
512+ "To abort and get back to the state before \"git revert\",\n"
513+ "run \"git revert --abort\"." ));
511514 else
512515 BUG ("unexpected pick action in print_advice()" );
513516 }
0 commit comments