git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] doc: clarify "do not capitalize the first word" rule
@ 2021-04-14 23:51 Junio C Hamano
  2021-04-15  9:16 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2021-04-14 23:51 UTC (permalink / raw)
  To: git

The same "do not capitalize the first word" rule is applied to both
our patch titles and error messages, but the existing description
was fuzzy in two aspects.

 * For error messages, it was not said that this was only about the
   first word that begins the sentence.

 * For both, it was not clear when a capital letter there was not an
   error.  We avoid capitalizing the first word when the only reason
   you would capitalize it is because it happens to be the first
   word in the sentence.  If a proper noun that is usually spelled
   in caps happens to come at the beginning of the sentence, that is
   not a reason to downcase it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * I saw in the GGG inbox a well-intended patch that took the "do
   not capitalize" rule too far, but with documentation unclear, it
   was understandable, so here is to remedy the situation.

 Documentation/CodingGuidelines  |  7 ++++++-
 Documentation/SubmittingPatches | 11 +++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git c/Documentation/CodingGuidelines w/Documentation/CodingGuidelines
index 45465bc0c9..86d2afd6d2 100644
--- c/Documentation/CodingGuidelines
+++ w/Documentation/CodingGuidelines
@@ -498,7 +498,12 @@ Error Messages
 
  - Do not end error messages with a full stop.
 
- - Do not capitalize ("unable to open %s", not "Unable to open %s")
+ - Do not capitalize the first word, only because the word is the
+   first word in the message ("unable to open %s", not "Unable to open
+   %s", but "SHA-3 not supported" is fine, as the reason the first
+   word is capitalized is not because it is at the beginning of the
+   sentence, but because the word would be spelled with caps even when
+   it appeared in the middle of the sentence).
 
  - Say what the error is first ("cannot open %s", not "%s: cannot open")
 
diff --git c/Documentation/SubmittingPatches w/Documentation/SubmittingPatches
index 0452db2e67..aee56cf127 100644
--- c/Documentation/SubmittingPatches
+++ w/Documentation/SubmittingPatches
@@ -117,10 +117,13 @@ If in doubt which identifier to use, run `git log --no-merges` on the
 files you are modifying to see the current conventions.
 
 [[summary-section]]
-It's customary to start the remainder of the first line after "area: "
-with a lower-case letter. E.g. "doc: clarify...", not "doc:
-Clarify...", or "githooks.txt: improve...", not "githooks.txt:
-Improve...".
+The title sentence after the "area:" prefix omits the full stop at the
+end, and its first word is not capitalized unless there is a reason to
+capitalize it other than that it is the first word in the sentence.
+E.g. "doc: clarify...", not "doc: Clarify...", or "githooks.txt:
+improve...", not "githooks.txt: Improve...".  But "refs: HEAD is also
+treated as a ref" is correct, as we spell `HEAD` in all caps even when
+it appears in the middle of a sentence.
 
 [[meaningful-message]]
 The body should provide a meaningful commit message, which:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] doc: clarify "do not capitalize the first word" rule
  2021-04-14 23:51 [PATCH] doc: clarify "do not capitalize the first word" rule Junio C Hamano
@ 2021-04-15  9:16 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2021-04-15  9:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Wed, Apr 14, 2021 at 04:51:17PM -0700, Junio C Hamano wrote:

> The same "do not capitalize the first word" rule is applied to both
> our patch titles and error messages, but the existing description
> was fuzzy in two aspects.
> 
>  * For error messages, it was not said that this was only about the
>    first word that begins the sentence.
> 
>  * For both, it was not clear when a capital letter there was not an
>    error.  We avoid capitalizing the first word when the only reason
>    you would capitalize it is because it happens to be the first
>    word in the sentence.  If a proper noun that is usually spelled
>    in caps happens to come at the beginning of the sentence, that is
>    not a reason to downcase it.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> 
>  * I saw in the GGG inbox a well-intended patch that took the "do
>    not capitalize" rule too far, but with documentation unclear, it
>    was understandable, so here is to remedy the situation.

After reading the patch, I wouldn't have thought it needed to be spelled
out, but if you saw a case in the wild, it doesn't hurt to be as clear
as possible.

The patch text itself looks good to me.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-15  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 23:51 [PATCH] doc: clarify "do not capitalize the first word" rule Junio C Hamano
2021-04-15  9:16 ` Jeff King

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).