Re: How to make devs write better commit messages

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

 



Michael Schubert <mschub@xxxxxxxxxxxxx> 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.
--
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]