git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] checkout: Say “it” instead of “them” for one commit

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 1, 2015, 19:43 UTC
Message-ID
<20150401194310.GH22844@google.com>
In-Reply-To
<1427909880-9846-1-git-send-email-thosch97@gmail.com>
Hi,
Thomas Schneider wrote:
Show 5 quoted lines
> When detached and checking out a branch again, git checkout warns about
> commit(s) that might get lost.  It used to say “If you want to keep them
> […]” even for only one commit.
>
> Signed-off-by: Thomas Schneider <thosch97@gmail.com>
Makes sense.
[...]
Show 20 quoted lines
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -743,10 +743,17 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
>  
>  	if (advice_detached_head)
>  		fprintf(stderr,
> -			_(
> +			Q_(
> +			/* The singular version */
> +			"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",
> +			/* The plural version */
>  			"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",
> +			/* Give ngettext() the count */
> +			lost),
>  			find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV));

The comments for /* singular */, /* plural */, and /* count */ seem redundant and distracting to me, but since we have the same comments a few lines before, keeping it consistent is the right thing to do.

For what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Previous: Thomas SchneiderNext: Thomas Schneider
Message 2 of 3 in “checkout: Say “it” instead of “them” for one commit”
  1. checkout: Say “it” instead of “them” for one commitThomas Schneider, Apr 1, 2015
  2. Jonathan NiederApr 1, 2015
  3. Thomas SchneiderApr 2, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.