Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

github repository commit watcher -- keep your eye on new commits from multiple repos through an interactive CLI

branch: master

fix time helper problem, bump to 0.3.6

change Notification module to Notifiable. Update license. Change all
require_relatives to File.expand_path.
latest commit 28a7bc4d16
Luke Gruber authored April 07, 2012
Octocat-spinner-32 bin
Octocat-spinner-32 images
Octocat-spinner-32 lib
Octocat-spinner-32 tasks
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 hubeye.gemspec
Octocat-spinner-32 version.rb
README.md

Hubeye


Keep track of repositories on Github, get notified when they change and
(optionally) run local system commands when new commits get pushed to certain repositories.

Hubeye is composed of a client and server. Once the server is run,
you can connect to it via the client. Once connected, you'll be
prompted by a '>'. Type in the name of a Github repository.

Example: (what the user enters is preceded by the prompt)

> hubeye
log tracking info for repos on client quit
=> luke-gru

What you see is the latest commit message and committer for that repository.
Note that we did not type a username. This is because we defined
a username in our ~/.hubeye/hubeyerc file.

Once a repo is in the watch list, typing it again will go and see if it has changed.

> hubeye
Repository luke-gru/hubeye has not changed.

If, however, luke-gru/hubeye was pushed to since we last typed it in,
it'll tell us that there have been changes, and what the new commit
message is.

Starting Hubeye

To start the server:

> hubeye -s

or just

> hubeye

This starts the server as a daemonized process. To run the server in
your terminal:

> hubeye -st

Hubeye runs on port 4545 by default. Change the port like this:

> hubeye -sp 9001

To connect using the client:

> hubeye -c

For more options:

> hubeye -h

Basic ~/.hubeye/hubeyerc Configuration

username: luke-gru

This allows the user to type a repository name only, and to receive
information regarding that username's repository. The username
should be a valid Github username.

Keeping Track of Repositories

You can add another user's repo like this:

> rails/rails

or > add rails/rails

If you want to add multiple repos at once, use the
'add repo1 other_user/repo2 repo3 ' syntax

Hubeye doesn't actually enter its tracking loop unless you disconnect
from the server and leave the server running. This can be done by:

> quit
Bye!

If Hubeye has any repos to track, it will watch Github for changes.
It can keep track of as many repos as you want; just keep typing
them in. If Hubeye finds a change to a repo, it will notify you of the
changes using your Desktop notification system (libnotify, growl). It will
also log the changes to your $HOME/.hubeye/log file. If the server is run
in a terminal (-t option), the changes will also be logged there.

Note that since the server is still running, you can connect to it using the
client any time to add more repos to track, or to check the current commits.

To track your own repository, start the client in the root directory
of your local git repo:

> .

This only works if a username is added to the hubeyerc, and if the
Github repository name is the same as the basename of $PWD
ie: '.' put in '/home/luke/code/hubeye' would track https://www.github.com/luke-gru/hubeye if username were set to luke-gru.

This adds https://github.com/rails/rails to the watch list.
Hubeye does not remove a repo from the watch list unless explicitly
told to do so:

> rm luke-gru/hubeye

To remove all tracked repos, simply:

> rm -a

To see a list of all repos that Hubeye is tracking:

> tracking

To see a more detailed list, including commit messages:

> tracking -d

Desktop Notification

On Linux: install libnotify-bin. On Mac: install growl (if not already installed).
The autotest gem is needed for Desktop notification to work with growl.
Desktop notification is currently untested with growl, so please send error reports if
you have any problems, or fork Hubeye and help out!

Shutting Down and Persistence between Sessions

> shutdown

Next time you start up the server, the watch list will be empty
(and so will the log file). In order to have a default watch list:

~/.hubeye/hubeyerc

track: rails/rails, dchelimsky/rspec

These will be watched automatically when starting up the server.

A way to interactively save all currently tracked repositories:

> save repos as my_work_repos

And then load them any time (even after a shutdown, next session, next week, etc...)

> load repos my_work_repos

This puts the repository names in the watch list with their most recent commits, not the commits that were being tracked when you saved the repos.

Working with Hooks

> hook add rails/rails dir: /path/to/local/rails cmd: git pull origin master

When https://www.github.com/rails/rails changes, a process will start,
change to the selected directory and execute the command. The (dir: /my/dir)
part is optional, and when ignored won't change directories. In that case,
the directory in which the command is executed will be where the Hubeye server
was originally started.

If you want to call your own script with a hook and pass it the changed repo
name, you can find the changed repo name by accessing ENV['HUBEYE_CHANGED_REPO']
in your script. Example:

> hook add rails/rails dir: /path/to/email/script cmd: ./email_me.rb

In email_me.rb, ENV['HUBEYE_CHANGED_REPO'] will be rails/rails.

To see all currently loaded hooks:

> hook list

To save all hooks for next sessions (after a server shutdown)

> save hooks as weekend_projects_hooks

Then, next weekend:

> load hooks weekend_projects_hooks

These hooks, of course, will only really do anything if the repositories they
are hooked to are currently being watched. This is not done automatically.

All ~/.hubeye/hubeyerc Configurations

When the server is started, the options are set here.

username: luke-gru
track: username/reponame, username2/reponame2, myreponame
oncearound: 90
load hooks: myhook1, myworkhooks
load repos: workprojects, funprojects
desktop notification: on

username: username used for Github URLS when the full path is not
given inside of the client

track: default repositories to watch for changes upon server start

oncearound: number of seconds before completing a check of every repo in
the watch list for changes

load hooks: hooks to load on server start. To see how to save hooks in the
client, see the Working with hooks section

load repos: repos to load on server start. To see how to save repos in the
client, see the Shutting down and persistence between sessions section.

desktop notification: whether to notify of repo changes using libnotify
or growl. This is set to on by default. However, if no notification
system is found, it is ignored.

Something went wrong with that request. Please try again.