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

Re: [PATCH 1/3] SubmittingPatches: add convention of prefixing commit messages

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 16, 2012, 23:15 UTC
Message-ID
<7vobhtpp1d.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1355686561-1057-2-git-send-email-git@adamspiers.org>
Adam Spiers <git@adamspiers.org> writes:
Show 26 quoted lines
> Conscientious newcomers to git development will read SubmittingPatches
> and CodingGuidelines, but could easily miss the convention of
> prefixing commit messages with a single word identifying the file
> or area the commit touches.
>
> Signed-off-by: Adam Spiers <git@adamspiers.org>
> ---
>  Documentation/SubmittingPatches | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
> index 0dbf2c9..c107cb1 100644
> --- a/Documentation/SubmittingPatches
> +++ b/Documentation/SubmittingPatches
> @@ -9,6 +9,14 @@ Checklist (and a short version for the impatient):
>  	- the first line of the commit message should be a short
>  	  description (50 characters is the soft limit, see DISCUSSION
>  	  in git-commit(1)), and should skip the full stop
> +	- it is also conventional in most cases to prefix the
> +	  first line with "area: " where the area is a filename
> +	  or identifier for the general area of the code being
> +	  modified, e.g.
> +	  . archive: ustar header checksum is computed unsigned
> +	  . git-cherry-pick.txt: clarify the use of revision range notation
> +	  (if in doubt which identifier to use, run "git log --no-merges"
> +	  on the files you are modifying to see the current conventions)

Thanks; I have to wonder if these details should be left in the longer version to keep the "short" one short, though.

We should probably add "learn from good examples." (aka "read 'git log' output and the pattern should be obvious to you") as the first item to this list, too.

>  	- the body should provide a meaningful commit message, which:
>  	  . explains the problem the change tries to solve, iow, what
>  	    is wrong with the current code without the change.
Previous: Adam SpiersNext: Adam Spiers
Message 3 of 10 in “Help newbie git developers avoid obvious pitfalls”
  1. 0/3 Help newbie git developers avoid obvious pitfallsAdam Spiers, Dec 16, 2012
  2. 1/3 SubmittingPatches: add convention of prefixing commit messagesAdam Spiers, Dec 16, 2012
  3. Junio C HamanoDec 16, 2012
  4. 2/3 Documentation: move support for old compilers to CodingGuidelinesAdam Spiers, Dec 16, 2012
  5. 3/3 Makefile: use -Wdeclaration-after-statement if supportedAdam Spiers, Dec 16, 2012
  6. Junio C HamanoDec 17, 2012
  7. Adam SpiersDec 17, 2012
  8. Junio C HamanoDec 17, 2012
  9. Adam SpiersDec 22, 2012
  10. Junio C HamanoDec 22, 2012

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.