Thread (1 message) 1 message, 1 author, 2016-06-15

Re: How to make devs write better commit messages

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:34

Michael Schubert [off-list ref] writes:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help