From: Junio C Hamano <gitster@pobox.com>
To: "阿德烈 via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, 阿德烈 <adlternative@gmail.com>
Subject: Re* [PATCH] builtin/*: update usage format
Date: Tue, 05 Jan 2021 23:05:22 -0800 [thread overview]
Message-ID: <xmqqwnwqtuj1.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: pull.822.git.1609232114080.gitgitgadget@gmail.com
"阿德烈 via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: ZheNing Hu <adlternative@gmail.com>
>
> According to the "Error Messages" section of
> Documentation/CodingGuidelines, we should not end in a full
> stop or start with a capital letter.
Yup, error("message"), die("message") and warn("messages") lack the
final full stop and starts with lowercase.
> OPT_CMDMODE(0, "abort", &resume.mode,
> - N_("restore the original branch and abort the patching operation."),
> + N_("restore the original branch and abort the patching operation"),
> RESUME_ABORT),
But is this an error message? I do not think so.
> ...
> struct option options[] = {
> - OPT__QUIET(&quiet, N_("Suppress output for setting url of a submodule")),
> + OPT__QUIET(&quiet, N_("suppress output for setting url of a submodule")),
> OPT_END()
> };
Having said that, I do not *mimd* standardising the usage help
strings in the same way. I do not think the "Error Messages"
section is the one we want to use for the justification of this
patch.
Perhaps a preparatory patch like the attached would be a good way
forward? I dunno.
---- >8 -------- >8 -------- >8 -------- >8 -------- >8 ----
Subject: parse-options: format argh like error messages
"Keep it homogeneous across the repository" is in general a
guideline that can be used to converge to a good practice, but
we can be a bit more prescriptive in this case. Just like the
messages we give die(_("...")) are formatted without the final
full stop and without the initial capitalization, most of the
argument help text are already formatted that way, and we want
to encourage that as the house style.
Noticed-by: ZheNing Hu <adlternative@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
parse-options.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git c/parse-options.h w/parse-options.h
index 7030d8f3da..ff6506a504 100644
--- c/parse-options.h
+++ w/parse-options.h
@@ -82,9 +82,9 @@ typedef enum parse_opt_result parse_opt_ll_cb(struct parse_opt_ctx_t *ctx,
* stores pointers to the values to be filled.
*
* `argh`::
- * token to explain the kind of argument this option wants. Keep it
- * homogeneous across the repository. Should be wrapped by N_() for
- * translation.
+ * token to explain the kind of argument this option wants. Does not
+ * begin in capital letter, and does not end with a full stop.
+ * Should be wrapped by N_() for translation.
*
* `help`::
* the short help associated to what the option does.
next prev parent reply other threads:[~2021-01-06 7:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 8:55 [PATCH] builtin/*: update usage format 阿德烈 via GitGitGadget
2020-12-29 14:33 ` Felipe Contreras
2021-01-06 7:05 ` Junio C Hamano [this message]
2021-01-06 12:03 ` Re* " Derrick Stolee
2021-01-06 11:51 ` [PATCH v2 0/2] " 阿德烈 via GitGitGadget
2021-01-06 11:51 ` [PATCH v2 1/2] " ZheNing Hu via GitGitGadget
2021-01-06 11:51 ` [PATCH v2 2/2] parse-options: format argh like error messages Junio C Hamano via GitGitGadget
2021-01-06 12:05 ` Derrick Stolee
2021-01-06 14:44 ` [PATCH v3 0/2] builtin/*: update usage format 阿德烈 via GitGitGadget
2021-01-06 14:44 ` [PATCH v3 1/2] parse-options: format argh like error messages Junio C Hamano via GitGitGadget
2021-01-06 14:44 ` [PATCH v3 2/2] builtin/*: update usage format ZheNing Hu via GitGitGadget
2021-01-06 23:14 ` [PATCH v3 0/2] " Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2021-01-06 11:07 Re* [PATCH] " 胡哲宁
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwnwqtuj1.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=adlternative@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).