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

Re: [PATCH] submodule: add newline on invalid submodule error

From
Derrick Stolee <stolee@gmail.com>
Date
Feb 7, 2020, 13:55 UTC
Message-ID
<aacd5724-fdb6-832c-4af9-22c1831baea2@gmail.com>
In-Reply-To
<20200207004833.255965-1-emilyshaffer@google.com>
On 2/6/2020 7:48 PM, Emily Shaffer wrote:
Show 5 quoted lines
> Since 'err' contains output for multiple submodules and is printed all
> at once by fetch_populated_submodules(), errors for each submodule
> should be newline separated for readability. The same strbuf is added to
> with a newline in the other half of the conditional where this error is
> detected, so make the two consistent.

A worthy goal, and thanks for pointing out that this matches the "Fetching submodule %s%s\n" string in the other block.

> -					    _("Could not access submodule '%s'"),
> +					    _("Could not access submodule '%s'\n"),

My initial thought was that this `\n` should be added in front of the string, and only if the string has existing data. However, that's not what happens in the other block, so doing it that way would require changing both places. This approach is also less error-prone, even if it may result in an "extra" newline at the end of all the messages.

LGTM.

Thanks, -Stolee

Previous: Emily Shaffer
Message 2 of 2 in “submodule: add newline on invalid submodule error”
  1. submodule: add newline on invalid submodule errorEmily Shaffer, Feb 7, 2020
  2. Derrick StoleeFeb 7, 2020

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.