[petsc-dev] Commit messages too long

Sean Farley sean at mcs.anl.gov
Mon Sep 17 13:02:09 CDT 2012


Here is a great example of a commit message that is too long:

http://petsc.cs.iit.edu/petsc/petsc-dev/rev/afd649815e1a

Which ends up looking like this in the log:

o ts: add option for nonlinear failures per timestep
|
o Fix to SNESMF behavior; the computejacobian function is no longer reset to
|  MatMFFDComputeJacobian when snes->mf is set, allowing for a jacobian
|  function to be passed to inner solvers (rather than MatMFFDComputeJacobian).

Rather, can we keep the first line of the commit message less
than 75 characters and then put a "\n\n" before the rest of the
message. Having commit messages explain what they do in detail is
great! ... just not in the first line. With short summaries in
the first line of the commit, we keep the log history looking
clean and easy to read. [^1]

For example, Peter's message could have been,

snesmf: fix behavior of passing jacobian to inner solvers

The computejacobian function is no longer reset to
MatMFFDComputeJacobian when snes->mf is set, allowing for a
jacobian function to be passed to inner solvers (rather than
MatMFFDComputeJacobian).

[^1]: Even Barry is getting better about his commit messages!

P.S. - Perhaps this looks ok in emacs when editing the commit message
due to line wrapping? Don't forget about the M-q shortcut.

P.P.S - Also, don't forget about the `hg amend` command for amending a
previous commit (including the message). See `hg amend -h` for more
info.



More information about the petsc-dev mailing list