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

Re: [PATCH] unpack-trees.c: align submodule error message to the other error messages

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 29, 2017, 22:47 UTC
Message-ID
<xmqq60ir8zv8.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170329223424.4678-1-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 38 quoted lines
> As the place holder in the error message is for multiple submodules,
> we don't want to encapsulate the string place holder in single quotes.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>
>> Nitpicking about wording: unless the user has adopted a strongly
>> object-oriented point of view, it is Git that cannot checkout a new
>> HEAD, not the submodule.
>> 
>> How about:
>> 
>>                 _("Cannot update submodule:\n%s")
>
>> That's vague, but if I understand correctly the way this error gets
>> used is equally vague --- i.e., a clearer message would involve
>> finer-grained error codes.
>
> Makes sense. Here is the patch.
> Let's roll this as its own instead of waiting for the discussion on the other
> patch to settle.
>
> Thanks,
> Stefan
>
>  unpack-trees.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/unpack-trees.c b/unpack-trees.c
> index 8333da2cc9..0d82452f7f 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -167,7 +167,7 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
>  	msgs[ERROR_WOULD_LOSE_ORPHANED_REMOVED] =
>  		_("The following working tree files would be removed by sparse checkout update:\n%s");
>  	msgs[ERROR_WOULD_LOSE_SUBMODULE] =
> -		_("Submodule '%s' cannot checkout new HEAD");
> +		_("Cannot update submodule:\n%s")

Missing ';'. I'll fix locally, but the final integration result won't be pushed out until later tonight, as I need to redo jch and pu branches with a fixed version.

>  
>  	opts->show_all_errors = 1;
>  	/* rejected paths may not have a static buffer */
Previous: Stefan BellerNext: Jonathan Nieder
Message 6 of 8 in “entry.c: submodule recursing: respect force flag correctly”
  1. 1/2 entry.c: submodule recursing: respect force flag correctlyStefan Beller, Mar 29, 2017
  2. 2/2 unpack-trees.c: align submodule error message to the other error messagesStefan Beller, Mar 29, 2017
  3. Jonathan NiederMar 29, 2017
  4. Junio C HamanoMar 29, 2017
  5. unpack-trees.c: align submodule error message to the other error messagesStefan Beller, Mar 29, 2017
  6. Junio C HamanoMar 29, 2017
  7. Jonathan NiederMar 29, 2017
  8. Junio C HamanoMar 29, 2017

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.