投稿数 585
公開から 2940

【Git】2019年版モダンなcommtメッセージの書き方


Categories: git

いきさつ

コミットメッセージどういうのがいいんですかね? こういうときにはモノマネしてくのが一番!

AngularJS Git Commit Message Conventions

Angularではコミットメッセージの規約なんてものがあるんですね! 参考になります。

AngularJS Git Commit Message Conventionsのシンタックス

<type>(<scope>): <subject>

type

build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) ci: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs) docs: Documentation only changes feat: A new feature fix: A bug fix perf: A code change that improves performance refactor: A code change that neither fixes a bug nor adds a feature style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) test: Adding missing tests or correcting existing tests

scope

here you define the scope of changes. For example: featureA, buildConfig, or any other scope you can think of.

subject

there are different methodologies to write the subject, but the main rules are as follows: use imperative, present tense. “fix” not “fixed”, “add” not “added”. By the way, Git also uses this convention for its own pre-formateed messages(“Merge pull request…”). don’t capitalize first letter do not add dot(.) at the end of subject

感想・まとめ

スコープはよくわからなかったのでもっと単純に

<type>: <subject>

これで良いような気がします。 あとstyleも不要かなchoreに含めてしまって良いような気がする。

feat: add support for creating custom elements

参考

https://github.com/angular/angular/blob/master/CONTRIBUTING.md

https://dev.to/aibolik/git-commit-message-41c1