Github提交观察程序
gicowa的Python项目详细描述
官方文件here。
gicowa.py-github提交观察程序
github的watch功能在提交 推。这个脚本旨在实现这个特性以及更多的功能。
安装
$ sudo apt-get install sendmail $ sudo pip install gicowa
快速设置
将以下行添加到您的/etc/crontab:
0 * * * * root gicowa --persist --no-color --mailto myself@mydomain.com lastwatchedcommits MyGitHubUsername sincelast > /tmp/gicowa 2>&1
就这样。只要你的机器在运行,你就会收到电子邮件 当你看到的回购被推到某个位置时。
NOTES:
- The e-mails are likely to be considered as spam until you mark one as non-spam in your e-mail client. Or use the ^{tt2}$ option.
- If you’re watching 15 repos or more, you probably want to use the ^{tt3}$ option to make sure you don’t hit the GitHub API rate limit.
其他/高级用法
gicowa是一个通用的命令行工具,您可以使用它 更重要的是,仅仅实现导言中描述的用例。 这个部分展示了它能做什么。
列出用户观看的回购
$ gicowa watchlist AurelienLourot
watchlist AurelienLourot
AurelienLourot/uncommitted
AurelienLourot/crouton-emacs-conf
brillout/FasterWeb
AurelienLourot/github-commit-watcher
列出回购协议的最后提交
$ gicowa lastrepocommits AurelienLourot/github-commit-watcher since 2015 07 05 09 12 00
lastrepocommits AurelienLourot/github-commit-watcher since 2015-07-05 09:12:00
Last commit pushed on 2015-07-05 10:48:58
Committed on 2015-07-05 10:46:27 - Aurelien Lourot - Minor cleanup.
Committed on 2015-07-05 09:39:01 - Aurelien Lourot - watchlist command implemented.
Committed on 2015-07-05 09:12:00 - Aurelien Lourot - argparse added.
NOTE: keep in mind that a commit’s committer timestamp isn’t
the time at which it gets pushed.
列出用户观看的回购的最后提交
$ gicowa lastwatchedcommits AurelienLourot since 2015 07 04 00 00 00
lastwatchedcommits AurelienLourot since 2015-07-04 00:00:00
AurelienLourot/crouton-emacs-conf - Last commit pushed on 2015-07-04 17:10:18
AurelienLourot/crouton-emacs-conf - Committed on 2015-07-04 17:08:48 - Aurelien Lourot - Support for Del key.
brillout/FasterWeb - Last commit pushed on 2015-07-04 16:40:54
brillout/FasterWeb - Committed on 2015-07-04 16:38:55 - brillout - add README
AurelienLourot/github-commit-watcher - Last commit pushed on 2015-07-05 10:48:58
AurelienLourot/github-commit-watcher - Committed on 2015-07-05 10:46:27 - Aurelien Lourot - Minor cleanup.
AurelienLourot/github-commit-watcher - Committed on 2015-07-05 09:39:01 - Aurelien Lourot - watchlist command implemented.
AurelienLourot/github-commit-watcher - Committed on 2015-07-05 09:12:00 - Aurelien Lourot - argparse added.
AurelienLourot/github-commit-watcher - Committed on 2015-07-05 09:07:14 - AurelienLourot - Initial commit
NOTE: if you’re watching 15 repos or more, you probably want to
use the ^{tt3}$ option to make sure you don’t hit the
GitHub API rate limit.
列出上次运行后的最后提交
任何采用since <timestamp>参数的listing命令也采用 sincelast一个。然后它将使用同一命令所具有的时间 最后一次在那台机器上运行 --persist。此选项使gicowa记住最后一次执行 在~/.gicowa中每个命令的时间。
$ gicowa --persist lastwatchedcommits AurelienLourot sincelast lastwatchedcommits AurelienLourot since 2015-07-05 20:17:46 $ gicowa --persist lastwatchedcommits AurelienLourot sincelast lastwatchedcommits AurelienLourot since 2015-07-05 20:25:33
通过电子邮件发送输出
您可以通过电子邮件将任何命令的输出发送给自己:
$ gicowa --no-color --mailto myself@mydomain.com lastwatchedcommits AurelienLourot since 2015 07 04 00 00 00 lastwatchedcommits AurelienLourot since 2015-07-04 00:00:00 AurelienLourot/crouton-emacs-conf - Last commit pushed on 2015-07-04 17:10:18 AurelienLourot/crouton-emacs-conf - Committed on 2015-07-04 17:08:48 - Aurelien Lourot - Support for Del key. brillout/FasterWeb - Last commit pushed on 2015-07-04 16:40:54 brillout/FasterWeb - Committed on 2015-07-04 16:38:55 - brillout - add README AurelienLourot/github-commit-watcher - Last commit pushed on 2015-07-05 10:48:58 AurelienLourot/github-commit-watcher - Committed on 2015-07-05 10:46:27 - Aurelien Lourot - Minor cleanup. AurelienLourot/github-commit-watcher - Committed on 2015-07-05 09:39:01 - Aurelien Lourot - watchlist command implemented. AurelienLourot/github-commit-watcher - Committed on 2015-07-05 09:12:00 - Aurelien Lourot - argparse added. AurelienLourot/github-commit-watcher - Committed on 2015-07-05 09:07:14 - AurelienLourot - Initial commit Sent by e-mail to myself@mydomain.com
NOTES:
- You probably want to use ^{tt11}$ because your e-mail client is likely not to render the bash color escape sequences properly.
- The e-mails are likely to be considered as spam until you mark one as non-spam in your e-mail client. Or use the ^{tt2}$ option.
变更日志
1.2.3(2015-10-17)至1.2.5(2015-10-19):
- 修正了非ascii字符的异常。
1.2.2(2015-10-12):
- 附加到电子邮件内容的计算机名。
1.2.1(2015-08-20):
- 改进了文档。
1.2.0(2015-08-20):
- --version选项已实现。
1.1.0(2015-08-20):
- --errorto选项已实现。
1.0.1(2015-08-18)至1.0.9(2015-08-19):
- 改进了文档。