Re: [PATCH v6 1/8] fetch: lowercase error messages
From: Anders Kaseorg <hidden>
Date: 2021-11-16 07:13:14
Subsystem:
the rest · Maintainer:
Linus Torvalds
On Tue, 16 Nov 2021, Junio C Hamano wrote:
quoted
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/
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