As graduates of Wyncode Academy, we want to be able to pair code while not sitting next to each other on the same network.
At least one person does not edit text files in the terminal.
Specifications:
Trivially solved with any app that supports voice chatting.
Easily solved with shared tmux session after users are granted shell access via ssh.
Not as trivial as the first 2 specs.
gitolite: http://gitolite.com/gitolite/index.html
gitolite is for hosting git repositories.
Python package watchdog: https://pypi.python.org/pypi/watchdog
For watching a directory and initiating an automated series of steps after file changes.
The file changes trigger a commit and push to the git repo from which all other users can pull.
The pull can be initiated by using watchdog to watch the designated gitolite repo
watchdog package installed.~/gitolite-admin/conf/gitolite.conf. In this example let's call the new pair coding repo $new_project_name.
In [5]:
new_project_name = 'trial-setup'
It is possible to view the current repos with this command:
In [2]:
!./bin/gitolite-info
In [11]:
!./bin/git-clone $new_project_name
The cloned directory contains scripts to set up the direcotry for pair coding.
cd into the directory
In [7]:
!cd $new_project_name
./setup "$new_project_name"
Then run:
./watchdog
And the watching should begin. All file changes should result in a commit and push.
In [22]:
# %load watchdog
#!/bin/bash
./automated_git.sh 2>&1 > watchdog.log & # start watchdog and redirect output to log and put in background
In [23]:
# %load automated_git.sh
#!/bin/bash
watchmedo shell-command \
--patterns='*' \
--ignore-patterns='.git *.log' \ # avoid race condition when these files update from the update
--command='git add -A && git commit -m replaced_by_hook && git push origin master'
./get-watchdog-pid
kill $pid
./kill-all-watchdogs
As that file is updated another user can copy and paste items from it. Sometimes it's easier than saying what should be typed. Can be used as a scratch pad, too. It is instantly updated to all those subscribed to the web page it produces.