LoginSignup
13
8

More than 5 years have passed since last update.

Commit Message Conventions 日本語訳

Last updated at Posted at 2017-10-19

はじめに

英語の勉強ついでに、気になっていた資料である、 stephenparish/commit.md の日本語訳をしてみました。

誤訳も多数あると思いますが、見つけたらコメント等で指摘いただけると幸いです。

Goals

  • スクリプトによる CHANGELOG.md の生成
  • git bisect による重要でないコミットの探索
  • 履歴閲覧の際のわかりやすい情報の提供

Generating CHANGELOG.md

  • changelogには主に以下の3つの項目がある
    • 新規追加された機能
    • バグの修正
    • 互換性を破る変更

これらはリリース時にスクリプトによって生成可能だ

全コミットメッセージの一行目のリスト :

git log <last tag> HEAD --pretty=format:%s

当リリースのfeatureのリスト :

git log <last release> HEAD --grep feature

Recognizing unimportant commits

細微調整などの無視できるコミットを見つけた際は :

git bisect skip $(git rev-list --grep irrelevant <good place> HEAD)

Provide more information when browsing the history

  • 追加情報を与えられるようなメッセージの例

    • Fix small typo in docs widget (tutorial instructions)
      • doc内の小さなタイピングミスの修正
    • Fix test for scenario.Application - should remove old iframe
      • アプリケーションテストのコード修正
    • docs - various doc fixes
      • 様々なdocの修正
    • docs - stripping extra new lines
      • doc内の余分な行の削除
    • Replaced double line break with single when text is fetched from Google
      • Googleからクロールしたテキストの改行二つを一つに置換
    • Added support for properties in documentation
      • ドキュメントのプロパティへのサポートの追加
  • 仕様変更箇所がわからないメッセージの例

    • fix comment stripping
      • コメントの削除
    • fixing broken links
      • リンク不備の修正
    • Bit of refactoring
      • 細微のリファクタリング
    • Check whether links do exist and throw exception
      • リンクが存在するかを確認し、例外処理を行う
    • Fix sitemap include (to work on case sensitive linux)
      • サイトマップの修正(大文字と小文字にを区別するlinux上での動作の為)

もちろん、変更箇所を探すことはできるが、時間がかかってしまう

Format of the commit message

 <type>(<scope>): <subject>
 <BLANK LINE>
 <body>
 <BLANK LINE>
 <footer>
  • コミットメッセージの各行には100文字までしか書けない
  • 簡単で読みやすく、かつ短いコミットメッセージが求められる

Subject line

Subject lineは変更の簡潔な説明のこと

  • Allowed <type>

    • feat (feature) - 新しいファイルや関数の追加
    • fix (bug fix) - バグの修正
    • docs (documentation) - 資料の修正、追加
    • style (formatting, missing semi colons, …) - コード自体のフォーマット変更
    • refactor - リファクタリング
    • test (when adding missing tests) - リリース前のテスト時に使用(?)
    • chore (maintain) - 変更していないファイルに対するコミットメッセージ
  • Allowed <scope>

    • 変更箇所の場所について
    • 場所、ブラウザ、コンパイル、権限許可範囲、タグなど...
  • <subject> text

    • 命令形を使用する
    • 一人称単数の動詞を使い、現在形で書くbr
      • 例) change ( changed でも changes でもない)
    • 小文字で始める
    • . を使用しない

Message body

  • 命令形のように、動詞から始める
  • 一人称単数の動詞を使い、現在形で書く
    • 例) change ( changed でも changes でもない)
  • 変更と、以前の動作との差の説明を含める

Message footer

  • 互換性を破る変更について(Breaking changes)
    • 変更の説明
    • 変更理由
    • (あまり使用しないデータの)退避についてのメモ
  • 関連するissueについて (Referencing issues)
    • Closedされたissueのタグを記載
    • Closed #234
    • Closed #123, #245, #992

Example

feat($browser): onUrlChange event (popstate/hashchange/polling)

Added new event to $browser:
- forward popstate event if available
- forward hashchange event if popstate not available
- do polling when neither popstate nor hashchange available

Breaks $browser.onHashChange, which was removed (use onUrlChange instead)
fix($compile): couple of unit tests for IE9

Older IEs serialize html uppercased, but IE9 does not...
Would be better to expect case insensitive, unfortunately jasmine does
not allow to user regexps for throw expectations.

Closes #392
Breaks foo.bar api, foo.baz should be used instead
feat(directive): ng:disabled, ng:checked, ng:multiple, ng:readonly, ng:selected

New directives for proper binding these attributes in older browsers (IE).
Added coresponding description, live examples and e2e tests.

Closes #351
style($location): add couple of missing semi colons
docs(guide): updated fixed docs from Google Docs

Couple of typos fixed:
- indentation
- batchLogbatchLog -> batchLog
- start periodic checking
- missing brace
feat($compile): simplify isolate scope bindings

Changed the isolate scope binding options to:
  - @attr - attribute binding (including interpolation)
  - =model - by-directional model binding
  - &expr - expression execution binding

This change simplifies the terminology as well as
number of choices available to the developer. It
also supports local name aliasing from the parent.

BREAKING CHANGE: isolate scope bindings definition has changed and
the inject option for the directive controller injection was removed.

To migrate the code follow the example below:

Before:

scope: {
  myAttr: 'attribute',
  myBind: 'bind',
  myExpression: 'expression',
  myEval: 'evaluate',
  myAccessor: 'accessor'
}

After:

scope: {
  myAttr: '@',
  myBind: '@',
  myExpression: '&',
  // myEval - usually not useful, but in cases where the expression is assignable, you can use '='
  myAccessor: '=' // in directive's template change myAccessor() to myAccessor
}

The removed `inject` wasn't generaly useful for directives so there should be no code using it.
13
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
8