Usefulness of Subject-header of git commit mails
Eike Hein
hein at kde.org
Sun Jan 23 23:13:26 GMT 2011
On 1/24/2011 12:03 AM, Allan Sandfeld Jensen wrote:
> Btw. This sounds like a really good format. Though I assume "commit subject"
> is still just the first line of the commit message, like it is commonly in
> git. When you have feature like that, the developers also needs to use that
> feature, so we need to format the commit messages better now. Hopefully it
> will come naturally to most developers.
Yep - for the benefit of those who aren't used to the git
jargon (sorry for that), in git the convention is to for-
mat the commit message like this:
<single line of about 50 chars, followed optionally by:>
<empty line>
<longer message>
While deviating from this format is not particularly harm-
ful, git and various tools based on git 'rely' on this
convention to varying degrees.
For example, the --format argument to control how various
git sub-commands display commit log data has the expandos
%s for subject and %b for body, where subject grabs the
first line. A %B expando to grab the full thing including
the empty line was actually only added in 2010, years into
git development.
So "commit subject" refers to that first line. Our code
of course ideally should be tolerant enough to also cope
with other formats, e.g. make some effort to extract the
full first sentence even if wrapped over several lines,
but also not go overboard on sending a gigantic subject.
> `Allan
--
Best regards,
Eike Hein
More information about the kde-core-devel
mailing list