From: Weijie Yuan <wy@wyuan.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael Montalbo <mmontalbo@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/6] SubmittingPatches: clarify expected structure of commit log message
Date: Mon, 13 Jul 2026 22:14:55 +0800 [thread overview]
Message-ID: <alTy306FaTAe2E8w@wyuan.org> (raw)
In-Reply-To: <xmqqcxwr3g7r.fsf@gitster.g>
On Sun, Jul 12, 2026 at 05:07:04PM -0700, Junio C Hamano wrote:
> Michael Montalbo <mmontalbo@gmail.com> writes:
>
> > I think collapsing the "Formatting and Style Guidelines" section with
> > the above would be clearer than having a separate section.
>
> Thanks for pointing it out; I tend to agree.
>
> Before rerolling the series in entirety, here is what I have in my
> editor buffer right now, after attempting to move the formatting and
> styles into the main description.
>
> I haven't checked if the formatting works as AsciiDoc yet, though.
>
> --- >8 ---
> [[meaningful-message]]
> ==== Structure of a Commit Message
>
> 1. Title:
> The first line of the commit log message is the title that lets
> readers of `git log --oneline` quickly understand what area the
> commit touches and what problem it addresses.
>
> - Keep it short (50 characters is the soft limit).
> - Skip the full stop at the end.
> - Prefix the subject with the modified area followed by a colon
> and a space (e.g., "area: subject"). The area is typically a
> filename or identifier (e.g., `doc:`, `transport:`, `t5601:`).
> Run `git log --no-merges` on target files to see conventions.
> - Do not capitalize the first word after the "area:" prefix
> unless there is a specific reason (e.g., `HEAD` is always in
> uppercase). For example, use "doc: clarify...", not "doc:
> Clarify...".
>
> 2. Body:
> A well-structured commit message body typically follows a
> three-part flow: Observation, Solution Design, and
> Implementation.
>
> - Leave a blank line between the title and the body.
> - Wrap lines in the body of the commit log message to around 70
> columns.
> - The body of the log message must be self-contained. Do not
> rely on external URLs (including mailing list archives) as the
> sole explanation. Summarize the relevant points of external
> material so that readers can understand the change with the log
> message alone.
>
> [[present-tense]]
> 3. Observation (The Status Quo):
> Explain the problem you are solving with your change by
> describing what is wrong with the current code *without* your
> change.
>
> - As this part is always about the current state by convention,
> words like "currently" are unnecessary.
> - Write this problem statement in the present tense (e.g., "The
> code does X when given input Y", not "The code did X").
>
> 4. Solution Design (The Approach):
> Explain the approach you took, justify how it solves the problem,
> and describe why you chose the particular design over other
> alternatives.
>
> - Focus on describing _why_, not _how_ (e.g., "The code does X
> when given input Y, but it should do Z _because_...").
> - If your change only addresses a subset of a larger problem
> (e.g., it handles directories but not files because ...),
> explain this limitation. This helps future developers
> understand the boundaries of your work and whether it can be
> safely extended.
> - If your change resolves design or viability concerns raised by
> the community during prior review rounds, ensure the message
> records the resolution, explaining why the chosen approach was
> accepted over alternatives.
>
> [[imperative-mood]]
> 5. Implementation (The Execution):
> Finally, describe how the changes are implemented.
>
> - Write this in the imperative mood (e.g., "Make xyzzy do frotz",
> not "This patch makes xyzzy do..." or "I changed xyzzy..."), as
> if you are instructing an agent to make changes to the
> codebase.
> - You do not have to repeat everything readers can discern from
> the patch text. Highlight the key points in your
> implementation.
I think this might confuse readers. Now you place these points in
parallel:
1. Title
2. Body
3. Observation (The Status Quo)
4. Solution Design (The Approach)
5. Implementation (The Execution)
But acatually you mean:
1. Title
2. Body
The body typically follows three parts:
a. Observation
b. Solution Design
c. Implementation
But I haven't written much about adoc, so I don't know its syntax and
how to write it.
next prev parent reply other threads:[~2026-07-13 14:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-11 19:26 [PATCH 0/6] Update Contributor Guides Junio C Hamano
2026-07-11 19:26 ` [PATCH 1/6] SubmittingPatches: clarify expected structure of commit log message Junio C Hamano
2026-07-12 14:49 ` Weijie Yuan
2026-07-12 16:07 ` Junio C Hamano
2026-07-13 14:14 ` Weijie Yuan
2026-07-12 20:26 ` Michael Montalbo
2026-07-13 0:07 ` Junio C Hamano
2026-07-13 14:14 ` Weijie Yuan [this message]
2026-07-11 19:26 ` [PATCH 2/6] MyFirstContribution: what if I don't get a reply? Junio C Hamano
2026-07-11 19:26 ` [PATCH 3/6] MyFirstContribution: carrying over trailers Junio C Hamano
2026-07-11 19:26 ` [PATCH 4/6] MyFirstContribution: clarify that 'seen' does not mean acceptance Junio C Hamano
2026-07-12 18:08 ` Matt Hunter
2026-07-12 19:04 ` Junio C Hamano
2026-07-11 19:26 ` [PATCH 5/6] SubmittingPatches: clarify the meaning of "Will queue" Junio C Hamano
2026-07-11 19:26 ` [PATCH 6/6] SubmittingPatches: clarify the writing style of whats-cooking Junio C Hamano
2026-07-12 20:41 ` Michael Montalbo
2026-07-13 4:20 ` Junio C Hamano
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=alTy306FaTAe2E8w@wyuan.org \
--to=wy@wyuan.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mmontalbo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.