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):

  • 改进了文档。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java从SVG中提取层   java通过蓝牙将文件从手机传输到其他手机   java如何使网络化JavaFX应用程序正确退出?   java Android Open GL不绘制正方形   java为什么使用泛型得到编译器警告?   多集群的Java Hazelcast问题   java OpenCV库配置正确,安卓应用程序可以正常运行一段时间,直到出现错误,表明不再加载该库   java字节好友通知中断Eclipse调试器   java JavaMail不会从发件人(Google除外)检索邮件   java使用MOXy将JsonObject属性映射到XML   java在FilteredTree中搜索“隐藏数据”   Javafx:用鼠标在ImageView上绘图   垃圾收集如何确定Java应用程序年轻gc的原因   java如何维护每个请求打开的Hibernate会话?   java gzip输入文件中的hadoop mapreduce   Java新手:Swing和显示ASCII文件   java RxJava异步订阅   java向editText添加搜索功能   java JavaFX TableViewTextField绑定