Gitで今日やった作業を振り返りたい時があります。
誰かに作業報告をメールでしなきゃいけない時とかありますよね。
面倒ですよね。
Gitのコミットログを送りつけてやりましょう。
以下のコマンドを実行すれば一発です。
1つ目のやつは自分が今いるブランチのログが簡単に取得できます。
2つ目のやつは全てのブランチの今日のコミットログが取れます。
今のブランチ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --after="`date '+%Y-%m-%d'` 0:0" --oneline |
すべてのブランチ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --after="`date '+%Y-%m-%d'` 0:0" --oneline --branches * |
色んな人のコミットログが入り乱れてて、自分のだけ抽出したいって場合でも、なんかオプションが有ると思います(調べていませんw)。
使用しているPCがmacの場合は先のコマンドをpbcopyってコマンドにパイプしてやればクリップボードにコピーされます。
下のような感じです。
そしたらメールに貼り付けて終了です。
報告業務が1分で完了しますね。
慣れてくれば30秒ぐらいです。
より慣れてくればmailコマンドにパイプすればいいので1秒で可能です。
以下の様な感じです(試してません)。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --after="`date '+%Y-%m-%d'` 0:0" --oneline | mail -s "本日の作業報告" butyo@example.com | |
楽ちんですね。
ちなみに深夜0時を跨いでから報告するというヘビープログラマの方は以下のコマンドがオススメです。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --after='24 hour ago' --oneline |
以上、dateコマンドを内部で展開しているチョッピリだけトリッキーなコマンドの紹介でした。
qiitaにも同じ内容のものを投稿してみました。
0 件のコメント:
コメントを投稿