--cleanup=<mode>
This option determines how the supplied commit message should be
cleaned up before committing. The <mode> can be strip, whitespace,
verbatim, or default.
strip
Strip leading and trailing empty lines, trailing whitespace,
and #commentary and collapse consecutive empty lines.
whitespace
Same as strip except #commentary is not removed.
verbatim
Do not change the message at all.
default
Same as strip if the message is to be edited. Otherwise
whitespace.
我想确定从提交消息hook中将应用哪种清理模式(必要时正确使用
commit.cleanup
config value)。我对我的提交消息运行了一些验证,我想确保我看到的正是Git计划使用的内容。或者,我可以接受一种方法来获取提交消息文本后清理(也许我可以欺骗Git为我清理它?)。对于我的用例来说,这将是很好的,因为我就不必担心重新实现任何清理模式了。