Merge branch 'js/merge-already-up-to-date-message-reword'

A few variants of informational message "Already up-to-date" has
been rephrased.

* js/merge-already-up-to-date-message-reword:
  merge: fix swapped "up to date" message components
  merge(s): apply consistent punctuation to "up to date" messages
This commit is contained in:
Junio C Hamano 2021-05-11 15:27:22 +09:00
commit 5feebddd86
4 changed files with 12 additions and 8 deletions

View file

@ -393,10 +393,14 @@ static void restore_state(const struct object_id *head,
} }
/* This is called when no merge was necessary. */ /* This is called when no merge was necessary. */
static void finish_up_to_date(const char *msg) static void finish_up_to_date(void)
{ {
if (verbosity >= 0) if (verbosity >= 0) {
printf("%s%s\n", squash ? _(" (nothing to squash)") : "", msg); if (squash)
puts(_("Already up to date. (nothing to squash)"));
else
puts(_("Already up to date."));
}
remove_merge_branch_state(the_repository); remove_merge_branch_state(the_repository);
} }
@ -1522,7 +1526,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
* If head can reach all the merge then we are up to date. * If head can reach all the merge then we are up to date.
* but first the most common case of merging one remote. * but first the most common case of merging one remote.
*/ */
finish_up_to_date(_("Already up to date.")); finish_up_to_date();
goto done; goto done;
} else if (fast_forward != FF_NO && !remoteheads->next && } else if (fast_forward != FF_NO && !remoteheads->next &&
!common->next && !common->next &&
@ -1610,7 +1614,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
} }
} }
if (up_to_date) { if (up_to_date) {
finish_up_to_date(_("Already up to date. Yeeah!")); finish_up_to_date();
goto done; goto done;
} }
} }

View file

@ -30,7 +30,7 @@ int merge_ort_nonrecursive(struct merge_options *opt,
return -1; return -1;
if (oideq(&merge_base->object.oid, &merge->object.oid)) { if (oideq(&merge_base->object.oid, &merge->object.oid)) {
printf(_("Already up to date!")); printf_ln(_("Already up to date."));
return 1; return 1;
} }

View file

@ -3462,7 +3462,7 @@ static int merge_trees_internal(struct merge_options *opt,
} }
if (oideq(&merge_base->object.oid, &merge->object.oid)) { if (oideq(&merge_base->object.oid, &merge->object.oid)) {
output(opt, 0, _("Already up to date!")); output(opt, 0, _("Already up to date."));
*result = head; *result = head;
return 1; return 1;
} }

View file

@ -628,7 +628,7 @@ int notes_merge(struct notes_merge_options *o,
if (oideq(&remote->object.oid, base_oid)) { if (oideq(&remote->object.oid, base_oid)) {
/* Already merged; result == local commit */ /* Already merged; result == local commit */
if (o->verbosity >= 2) if (o->verbosity >= 2)
printf("Already up to date!\n"); printf_ln("Already up to date.");
oidcpy(result_oid, &local->object.oid); oidcpy(result_oid, &local->object.oid);
goto found_result; goto found_result;
} }