{"thread":{"id":"29513","subject":"[PATCH v3] i18n: format_tracking_info \"Your branch is behind\" message","startedAt":"2012-02-02T02:02:23Z","lastAt":"2012-02-02T02:02:23Z","messageCount":1,"participants":["Jiang Xin"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"183534","messageId":"1328148143-88593-1-git-send-email-worldhello.net@gmail.com","threadId":"29513","inReplyTo":null,"subject":"[PATCH v3] i18n: format_tracking_info \"Your branch is behind\" message","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-02-02T02:02:23Z","receivedAt":"2012-02-02T02:02:23Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Function format_tracking_info in remote.c is called by\nwt_status_print_tracking in wt-status.c, which will print\nbranch tracking message in git-status. git-checkout also\nshow these messages through it's report_tracking function.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n remote.c |   32 +++++++++++++++++++++-----------\n 1 files changed, 21 insertions(+), 11 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex 73a38..af597 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1572,19 +1572,29 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)\n \tbase = branch->merge[0]->dst;\n \tbase = shorten_unambiguous_ref(base, 0);\n \tif (!num_theirs)\n-\t\tstrbuf_addf(sb, \"Your branch is ahead of '%s' \"\n-\t\t\t    \"by %d commit%s.\\n\",\n-\t\t\t    base, num_ours, (num_ours == 1) ? \"\" : \"s\");\n+\t\tstrbuf_addf(sb,\n+\t\t\tQ_(\"Your branch is ahead of '%s' by %d commit.\\n\",\n+\t\t\t   \"Your branch is ahead of '%s' by %d commits.\\n\",\n+\t\t\t   num_ours),\n+\t\t\tbase, num_ours);\n \telse if (!num_ours)\n-\t\tstrbuf_addf(sb, \"Your branch is behind '%s' \"\n-\t\t\t    \"by %d commit%s, \"\n-\t\t\t    \"and can be fast-forwarded.\\n\",\n-\t\t\t    base, num_theirs, (num_theirs == 1) ? \"\" : \"s\");\n+\t\tstrbuf_addf(sb,\n+\t\t\tQ_(\"Your branch is behind '%s' by %d commit, \"\n+\t\t\t       \"and can be fast-forwarded.\\n\",\n+\t\t\t   \"Your branch is behind '%s' by %d commits, \"\n+\t\t\t       \"and can be fast-forwarded.\\n\",\n+\t\t\t   num_theirs),\n+\t\t\tbase, num_theirs);\n \telse\n-\t\tstrbuf_addf(sb, \"Your branch and '%s' have diverged,\\n\"\n-\t\t\t    \"and have %d and %d different commit(s) each, \"\n-\t\t\t    \"respectively.\\n\",\n-\t\t\t    base, num_ours, num_theirs);\n+\t\tstrbuf_addf(sb,\n+\t\t\tQ_(\"Your branch and '%s' have diverged,\\n\"\n+\t\t\t       \"and have %d and %d different commit each, \"\n+\t\t\t       \"respectively.\\n\",\n+\t\t\t   \"Your branch and '%s' have diverged,\\n\"\n+\t\t\t       \"and have %d and %d different commits each, \"\n+\t\t\t       \"respectively.\\n\",\n+\t\t\t   num_theirs),\n+\t\t\tbase, num_ours, num_theirs);\n \treturn 1;\n }\n \n-- \n1.7.9.109.gd927b\n"}]}