git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael Schubert <mschub@elegosoft.com>
Cc: Joseph Huttner <huttnified@gmail.com>, git@vger.kernel.org
Subject: Re: How to make devs write better commit messages
Date: Tue, 06 Dec 2011 18:28:01 -0800	[thread overview]
Message-ID: <7vaa75cdzi.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4EDEA2E2.3030002@elegosoft.com> (Michael Schubert's message of "Wed, 07 Dec 2011 00:18:58 +0100")

Michael Schubert <mschub@elegosoft.com> writes:

>> What are your thoughts?
>
> If it's no social issue but just due to lack of a reminder you
> could provide a template for commit.template. Either way: you
> still would have to force people to set it.?

While that would be a good first step, I think people will learn best when
they feel by their skin how good log messages help them in the long run.

Pick a recent bugfix in your project, analyze why the code was broken by
the bug in the first place, and view the log message of the commit that
introduced the code that was broken by the buggy commit. You will often
notice that the original commit did not explain why the code needs to be
that way sufficiently, risking later breakage, and the buggy commit that
broke the code did not justify the change any more than "This happens to
make something work for me in a particular narrow case".

And then look at the log message of the bugfix. Does it explain why the
broken change was bad, and the fixed code _has to be_ that way?

Do this for a handful of examples, and you will start noticing patterns,
and what makes good messages that become useful in the longer term. Have
your people learn from good ones _as well as_ the bad ones.

Have fun.

  reply	other threads:[~2011-12-07  2:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06 22:55 How to make devs write better commit messages Joseph Huttner
2011-12-06 23:18 ` Michael Schubert
2011-12-07  2:28   ` Junio C Hamano [this message]
2011-12-07  0:08 ` Hilco Wijbenga
2011-12-07  7:06 ` Thomas Koch

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=7vaa75cdzi.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=huttnified@gmail.com \
    --cc=mschub@elegosoft.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 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 NNTP newsgroup(s).