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

Re: [PATCH v6 1/8] fetch: lowercase error messages

From
Anders Kaseorg <andersk@mit.edu>
Date
Nov 16, 2021, 07:10 UTC
Message-ID
<alpine.DEB.2.21.999.2111160206440.105644@scrubbing-bubbles.mit.edu>
In-Reply-To
<xmqqczn0d6er.fsf@gitster.g>
On Tue, 16 Nov 2021, Junio C Hamano wrote:
Show 9 quoted lines
> > Documentation/CodingGuidelines says “do not end error messages with a
> > full stop” and “do not capitalize the first word”.  Reviewers requested
> > updating the existing messages to comply with these guidelines prior to
> > the following patches.
> 
> Thanks.  Whether reviewers requested or you thought of it on your
> own, separating such a preliminary clean-up into its own patch would
> be a good idea, especially if the later patches need to update (some
> of) them.

It was your request; I just mentioned it in case other reviewers wonder why this belongs in this topic.

https://public-inbox.org/git/xmqq8rxvwp4b.fsf@gitster.g/
Show 15 quoted lines
> The approach chosen (consistently) in this patch is to
> 
>  (1) turn them into a (semi) single sentence, concatenated with ';'
> 
>  (2) as a side effect of not being a free-standing sentence anymore,
>      the second and subsequent sentences in the original, that are
>      now just pieces in a single sentence separated with ';', do not
>      get capitalized, and
> 
>  (3) the sentence as a whole lacks the full-stop, just like a single
>      sentence message.
> 
> I think we are fine with these rules, especially given that these
> multi-sentence messages are not the main part of this topic touches
> and are not the primary focus of this topic anyway.  

I guess I should add that there are a few messages I left alone: refuse_unconfigured_deny_msg and refuse_unconfigured_deny_delete_current_msg in builtin/receive-pack.c (patch 2/8). Not sure if they count as “error messages”, but these multi-paragraph messages are too long to comfortably apply this approach.

Now I see that I missed a few others. This could be squashed into the first three patches:

diff --git a/builtin/fetch.c b/builtin/fetch.c
index f373252490..f3c7c057d0 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1783,7 +1783,7 @@ static int fetch_failed_to_start(struct strbuf *out, void *cb, void *task_cb)
 	struct parallel_fetch_state *state = cb;
 	const char *remote = task_cb;
 
-	state->result = error(_("Could not fetch %s"), remote);
+	state->result = error(_("could not fetch %s"), remote);
 
 	return 0;
 }
@@ -1838,7 +1838,7 @@ static int fetch_multiple(struct string_list *list, int max_children)
 			if (verbosity >= 0)
 				printf(_("Fetching %s\n"), name);
 			if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
-				error(_("Could not fetch %s"), name);
+				error(_("could not fetch %s"), name);
 				result = 1;
 			}
 			strvec_pop(&argv);
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index d72058543e..70b4e23a26 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -2495,9 +2495,9 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
 	argc = parse_options(argc, argv, prefix, options, receive_pack_usage, 0);
 
 	if (argc > 1)
-		usage_msg_opt(_("Too many arguments."), receive_pack_usage, options);
+		usage_msg_opt(_("too many arguments"), receive_pack_usage, options);
 	if (argc == 0)
-		usage_msg_opt(_("You must specify a directory."), receive_pack_usage, options);
+		usage_msg_opt(_("you must specify a directory"), receive_pack_usage, options);
 
 	service_dir = argv[0];
 
diff --git a/branch.c b/branch.c
index 3a7d205fa4..0bea1335ae 100644
--- a/branch.c
+++ b/branch.c
@@ -64,7 +64,7 @@ int install_branch_config(int flag, const char *local, const char *origin, const
 	if (skip_prefix(remote, "refs/heads/", &shortname)
 	    && !strcmp(local, shortname)
 	    && !origin) {
-		warning(_("Not setting branch %s as its own upstream."),
+		warning(_("not setting branch %s as its own upstream"),
 			local);
 		return 0;
 	}
@@ -116,7 +116,7 @@ int install_branch_config(int flag, const char *local, const char *origin, const
 
 out_err:
 	strbuf_release(&key);
-	error(_("Unable to write upstream branch configuration"));
+	error(_("unable to write upstream branch configuration"));
 
 	advise(_(tracking_advice),
 	       origin ? origin : "",

Anders
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 21 in “protect branches checked out in all worktrees”
  1. 0/8 protect branches checked out in all worktreesAnders Kaseorg, Nov 13, 2021
  2. 1/8 fetch: lowercase error messagesAnders Kaseorg, Nov 13, 2021
  3. Junio C HamanoNov 16, 2021
  4. Anders KaseorgNov 16, 2021
  5. Junio C HamanoNov 17, 2021
  6. Jiang XinNov 22, 2021
  7. 2/8 receive-pack: lowercase error messagesAnders Kaseorg, Nov 13, 2021
  8. Junio C HamanoNov 18, 2021
  9. 5/8 fetch: protect branches checked out in all worktreesAnders Kaseorg, Nov 13, 2021
  10. Junio C HamanoNov 16, 2021
  11. Anders KaseorgNov 16, 2021
  12. Johannes SchindelinNov 22, 2021
  13. 3/8 branch: lowercase error messagesAnders Kaseorg, Nov 13, 2021
  14. 6/8 receive-pack: clean dead code from update_worktree()Anders Kaseorg, Nov 13, 2021
  15. Junio C HamanoNov 16, 2021
  16. 7/8 receive-pack: protect current branch for bare repository worktreeAnders Kaseorg, Nov 13, 2021
  17. 4/8 worktree: simplify find_shared_symref() memory ownership modelAnders Kaseorg, Nov 13, 2021
  18. Junio C HamanoNov 16, 2021
  19. Johannes SchindelinNov 22, 2021
  20. 8/8 branch: protect branches checked out in all worktreesAnders Kaseorg, Nov 13, 2021
  21. Johannes SchindelinNov 22, 2021

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.