Skip to content

Commit ad9322d

Browse files
jsorefsunshineco
authored andcommitted
merge: fix swapped "up to date" message components
The rewrite of git-merge from shell to C in 1c7b76b (Build in merge, 2008-07-07) accidentally transformed the message: Already up-to-date. (nothing to squash) to: (nothing to squash)Already up-to-date. due to reversed printf() arguments. This problem has gone unnoticed despite being touched over the years by 7f87aff (Teach/Fix pull/fetch -q/-v options, 2008-11-15) and bacec47 (i18n: git-merge basic messages, 2011-02-22), and tangentially by bef4830 (i18n: merge: mark messages for translation, 2016-06-17) and 7560f54 (treewide: correct several "up-to-date" to "up to date", 2017-08-23). Fix it by restoring the message to its intended order. While at it, help translators out by avoiding "sentence Lego". [es: rewrote commit message] Co-authored-by: Eric Sunshine <[email protected]> Signed-off-by: Josh Soref <[email protected]> Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 80cde95 commit ad9322d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

builtin/merge.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,14 @@ static void restore_state(const struct object_id *head,
393393
}
394394

395395
/* This is called when no merge was necessary. */
396-
static void finish_up_to_date(const char *msg)
396+
static void finish_up_to_date(void)
397397
{
398-
if (verbosity >= 0)
399-
printf("%s%s\n", squash ? _(" (nothing to squash)") : "", msg);
398+
if (verbosity >= 0) {
399+
if (squash)
400+
puts(_("Already up to date. (nothing to squash)"));
401+
else
402+
puts(_("Already up to date."));
403+
}
400404
remove_merge_branch_state(the_repository);
401405
}
402406

@@ -1522,7 +1526,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
15221526
* If head can reach all the merge then we are up to date.
15231527
* but first the most common case of merging one remote.
15241528
*/
1525-
finish_up_to_date(_("Already up to date."));
1529+
finish_up_to_date();
15261530
goto done;
15271531
} else if (fast_forward != FF_NO && !remoteheads->next &&
15281532
!common->next &&
@@ -1610,7 +1614,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
16101614
}
16111615
}
16121616
if (up_to_date) {
1613-
finish_up_to_date(_("Already up to date."));
1617+
finish_up_to_date();
16141618
goto done;
16151619
}
16161620
}

0 commit comments

Comments
 (0)