From: Junio C Hamano Date: Thu, 30 Jun 2011 00:03:10 +0000 (-0700) Subject: Merge branch 'jc/advice-about-to-lose-commit' X-Git-Tag: v1.7.7-rc0~125 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0faf247485c2dc92fd8b492a5c4b49237e0338ee;p=git.git Merge branch 'jc/advice-about-to-lose-commit' * jc/advice-about-to-lose-commit: checkout: make advice when reattaching the HEAD less loud Conflicts: builtin/checkout.c --- 0faf247485c2dc92fd8b492a5c4b49237e0338ee diff --cc builtin/checkout.c index 28cdc51b8,90870d953..015730fbd --- a/builtin/checkout.c +++ b/builtin/checkout.c @@@ -652,29 -631,20 +652,30 @@@ static void suggest_reattach(struct com } fprintf(stderr, - "Warning: you are leaving %d commit%s behind, " + Q_( + /* The singular version */ + "Warning: you are leaving %d commit behind, " + "not connected to\n" + "any of your branches:\n\n" - "%s\n" - "If you want to keep it by creating a new branch, " - "this may be a good time\nto do so with:\n\n" - " git branch new_branch_name %s\n\n", ++ "%s\n", + /* The plural version */ + "Warning: you are leaving %d commits behind, " "not connected to\n" "any of your branches:\n\n" - "%s\n" - "If you want to keep them by creating a new branch, " - "this may be a good time\nto do so with:\n\n" - " git branch new_branch_name %s\n\n", + "%s\n", - lost, ((1 < lost) ? "s" : ""), + /* Give ngettext() the count */ + lost), + lost, - sb.buf, - sha1_to_hex(commit->object.sha1)); + sb.buf); strbuf_release(&sb); + + if (advice_detached_head) + fprintf(stderr, ++ _( + "If you want to keep them by creating a new branch, " + "this may be a good time\nto do so with:\n\n" - " git branch new_branch_name %s\n\n", ++ " git branch new_branch_name %s\n\n"), + sha1_to_hex(commit->object.sha1)); } /*