How to make devs write better commit messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So I know that there is a somewhat standard format of commit messages
in Git, which Linus outlines here:

https://github.com/torvalds/subsurface/blob/master/README#L164

Trouble is, when most people go to commit, the file that the editor
opens has no reminder of how to write a proper commit message.  Often
I find myself having to go back through the commit log, or consulting
the above link.

I propose two things:

1.  An optional flag in the Git config that, if set, shows the format
of a typical commit message in your commit message template.

2.  The ability to modify this commit message template.  Many teams
use automated tools to read commit messages and then do automated
tasks based on that data, like comment an RT ticket.  Thus, developers
need to be reminded of these team-specific settings as well.

What are your thoughts?

The bottom line is that good commit messages are really important, so
we should make it as easy as possible for developers to go ahead and
write a perfect commit message every time they commit code.


E.g.


# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
# modified:   application/views/layouts/layout.phtml
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
# public/js/databases/
#
# How to properly format your commit message:
#
# 	Header line: explaining the commit in one line
#
#	Body of commit message is a few lines of text, explaining things
#	in more detail, possibly giving some background about the issue
#	being fixed, etc etc.
#
#	The body of the commit message can be several paragraphs, and
#	please do proper word-wrap and keep columns shorter than about
#	74 characters or so. That way "git log" will show things
#	nicely even when it's indented.
#
#	RT: 123, 456 [a comma-separated list of RT tickets this commit refers to]
#
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]