8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

git commitの度にコミットメッセージを再生する(Mac)

Posted at

Macではsayコマンドで音声合成を再生することができますので、それを利用します。

リポジトリのあるディレクトリで

$ vim .git/hook/post-commit

# !/bin/zsh
 
git log -1 HEAD --pretty=format:%s | read _msg
 
/usr/bin/say -v "Kathy" "$_msg"

$ chmod +x .git/hook/post-commit

とします。そして、

$ git commit -am "Hello"

のようにコミットすると「Hello」と合成音声で再生されます。

'Kathy'は英語しか話してくれないので、日本語が混じっているとうまく再生されません。
日本語のときは、'Kyoko' にします。

8
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
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?