プログラマー VTuber 衣亥栖ティオのちょっとした話

Youtubeに投稿したプログラミング学習動画の補足説明をするためのブログです。

プログラマーへの道 #195 の補足説明

こんにちは、プログラマーVTuberの衣亥栖ティオです。 この記事はYouTubeに投稿した動画の補足ブログです。

投稿した動画

今回は以下の動画の補足説明をします。


GitHub のURL

私のGitHubは以下です。
https://github.com/tio-iis

Gist のURL

私のGitst(メモ書きみたいなもの)のURLは以下です。
https://gist.github.com/tio-iis

今回の動画で実装したソースコード

今回の動画にソースコードはありません。

補足内容

git commitのコメントのフォーマットについて

動画内ではシンプルな1行のコメントを残していますが、実はちゃんとしたフォーマットが存在します。
https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines

フォーマットは以下のような構成になっています。

Capitalized, short (50 chars or less) summary

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 will confuse you if you run the
two together.

Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
or "Fixes bug."  This convention matches up with commit messages generated
by commands like git merge and git revert.

Further paragraphs come after blank lines.

- Bullet points are okay, too

- Typically a hyphen or asterisk is used for the bullet, followed by a
  single space, with blank lines in between, but conventions vary here

- Use a hanging indent

どういった変更なのかを詳細に記録することで、あとから他のエンジニアが見ても理解できる状態になります。 しかし、コミットのたびにこのようなコメントを残すのは大変なので、OSSでもない限りこのようなコメントを残す必要はないかなと思っています。