git-commit-template

  • 可以通过git config --global commit.template template.file来配置特定的commit log,template.file为模板。
  • 可以通过scripts/checkpatch.pl [patch or source file]来检查格式是否正确。
  • linux kernel的commit log建议使用如下模板:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    Short (50 chars or less) summary of changes

    More detailed explanatory text, if necessary. Wrap it to
    about 72 characters or so. In some contexts, the first
    line is treated as the subject of an email and the rest of
    the text as the body. The blank line separating the
    summary from the body is critical (unless you omit the body
    entirely); tools like rebase can get confused if you run
    the two together.

    Further paragraphs come after blank lines.

    - Bullet points are okay, too

    - Typically a hyphen or asterisk is used for the bullet,
    preceded by a single space, with blank lines in
    between, but conventions vary here
  • 参考资料:
    如何写好 Git commit log?
    git-commit-messages-50-72-formatting
    Documentation/process/submitting-patches.rst
    提交Linux内核Patch
    像linux kernel一样管理你的项目
    A Note About Git Commit Messages

Title:git-commit-template

Author:Victor Huang

Time:2019-03-17 / 16:03

Link:http://wowothink.com/ce5433ff/

License: Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)