Skip to content

Commit

Permalink
Closes #212 README updated with steps to enable lolcommits via templates
Browse files Browse the repository at this point in the history
Also tidied line length in README and some wording
  • Loading branch information
matthutchinson committed Sep 3, 2014
1 parent 0af7d44 commit 4bdd070
Showing 1 changed file with 104 additions and 31 deletions.
135 changes: 104 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# lolcommits (git + webcam = lol)

lolcommits takes a snapshot with your webcam every time you git commit code, and archives a lolcat style image with it.
Git blame has never been so much fun.
lolcommits takes a snapshot with your webcam every time you git commit code, and
archives a lolcat style image with it. Git blame has never been so much fun.

By default, the lolimages are stored by a Github style short SHA in a `~/.lolcommits` directory created for you.
By default, the lol images are stored by a Github style short SHA in a
`~/.lolcommits` directory created for you.

[![Gem Version](http://img.shields.io/gem/v/lolcommits.svg?style=flat)](https://rubygems.org/gems/lolcommits)
[![Build Status](http://img.shields.io/travis/mroth/lolcommits.svg?style=flat)](https://travis-ci.org/mroth/lolcommits)
Expand All @@ -12,62 +13,114 @@ By default, the lolimages are stored by a Github style short SHA in a `~/.lolcom
[![Coverage Status](http://img.shields.io/coveralls/mroth/lolcommits.svg?style=flat)](https://coveralls.io/r/mroth/lolcommits)

## Sample images

<img src="http://blog.mroth.info/images/postcontent/yearinsideprojects/lolcommits_users2.jpg" />

Please add your own lolcommit! Add to the [People Using Lolcommits](https://github.com/mroth/lolcommits/wiki/Lolcommits-from-around-the-world%21) page on the Wiki.
Please add your own lolcommit! Add to the [People Using
Lolcommits](https://github.com/mroth/lolcommits/wiki/Lolcommits-from-around-the-world%21)
page on our wiki.

## Installation

### Mac OS X
You'll need ImageMagick installed. [Homebrew](http://mxcl.github.com/homebrew/) makes this easy. Simply do:

You'll need ImageMagick installed. [Homebrew](http://mxcl.github.com/homebrew/)
makes this easy. Simply do:

brew install imagemagick

Then simply do:
Then install the gem with:

[sudo] gem install lolcommits

(If you're using RVM, you can/should probably omit the sudo, but the default MacOSX Ruby install is dumb and requires it.)
(If you're using RVM (or rbenv), you can/should probably omit the sudo, but the
default MacOSX Ruby install is dumb and requires it.)

### Linux
Install dependencies using your package manager of choice, for example in Ubuntu:

Install dependencies using your package manager of choice, for example in
Ubuntu:

sudo apt-get install mplayer imagemagick libmagickwand-dev

Then install the lolcommits gem:
Then install the gem with:

gem install lolcommits

For more details, see [Installing on Linux](https://github.com/mroth/lolcommits/wiki/Installing-on-Linux).
For more details, see [Installing on
Linux](https://github.com/mroth/lolcommits/wiki/Installing-on-Linux).

### Windows - here be dragons!

### Windows
Here be dragons! It all works but you'll need some more detailed instructions to get the dependencies installed. See the wiki page for [Installing on Windows](https://github.com/mroth/lolcommits/wiki/Installing-on-Windows).
It all works but you'll need some more detailed instructions to get the
dependencies installed. See the wiki page for [Installing on
Windows](https://github.com/mroth/lolcommits/wiki/Installing-on-Windows).

## Usage

### Enabling and basic usage
From within any git repository, simply do a `lolcommits --enable`. From that point on, any git commit will automatically trigger a lolcommit capture! All lolcommits are stored in `~/.lolcommits` by default, placed in a subdirectory by project name, and with a filename matching the commit hash.

Don't worry about it too much, half the fun of lolcommits is forgetting it's installed!
From within any git repository, simply do a `lolcommits --enable`. From that
point on, any git commit will automatically trigger a lolcommit capture! All
lolcommits are stored in `~/.lolcommits` by default, placed in a subdirectory by
project name, and with a filename matching the commit hash.

Don't worry about it too much, half the fun of lolcommits is forgetting it's
installed!

### Enabling for all Git repositories (via a hook template)

You can easily enable lolcommits across all your local git repos (and any repos
you may clone or add in the future). To do this use `git init` and the
`init.templatedir` setting, like so;

# after enabling lolcommits for a repo (explained above)
# create a template dir for hooks (if you don't already have one)
mkdir -p ~/.git_template/hooks
# tell git to use this template dir (globally)
git config --global init.templatedir '~/.git_template'
# copy the post-commit hook from any lolcommits enabled repo
cp [path/to/lolcommit-enabled-repo]/.git/hooks/post-commit ~/.git_template/hooks/
# navigate to all existing local repos on your machine and type
git init

Doing this should apply the template and hook to existing repos and any newly
cloned (or intialized) repos will get it too.

### Other commands
Ok, if you insist... Since you know about `--enable`, common sense suggests there is also a repository specific `--disable`, hopefully you can guess what that does. Other handy common commands include `--last`, which will open for display your most recent lolcommit image, or `--browse`, which pops open the directory containing all the lolcommit images for your current repository. You can always do `--help` for a full list of available commands.

**NOTE**: Any extra arguments you pass with the --enable command are auto-appended to the git-commit capture command. For example;
Ok, if you insist... Since you know about `--enable`, common sense suggests
there is also a repository specific `--disable`, hopefully you can guess what
that does. Other handy common commands include `--last`, which will open for
display your most recent lolcommit image, or `--browse`, which pops open the
directory containing all the lolcommit images for your current repository. You
can always do `--help` for a full list of available commands.

**NOTE**: Any extra arguments you pass with the --enable command are
auto-appended to the git-commit capture command. For example;

lolcommits --enable --delay=5 --animate=4 --fork

Will configure capturing of an animated gif (4 secs) after a 5 sec delay in a forked process. See the section below for more capture configuration variables.
Will configure capturing of an animated gif (4 secs) after a 5 sec delay in a
forked process. See the section below for more capture configuration variables.

### Capture configuration variables
lolcommits has some capture options for additional lulz. You can enable these via environment variables like so;

lolcommits has some capture options for additional lulz. You can enable these
via environment variables like so;

* `LOLCOMMITS_DEVICE` set a webcam device - **mac and linux only**
* `LOLCOMMITS_ANIMATE` (in seconds) set time for capturing an animated gif - **mac only & requires ffmpeg**
* `LOLCOMMITS_DELAY` (in seconds) set delay persistently (for slow webcams to warmup)
* `LOLCOMMITS_ANIMATE` (in seconds) set time for capturing an animated gif -
**mac only & requires ffmpeg**
* `LOLCOMMITS_DELAY` (in seconds) set delay persistently (for slow webcams to
warmup)
* `LOLCOMMITS_FONT` set font file location for lolcommit text
* `LOLCOMMITS_FORK` fork lolcommit runner (capture command forks to a new process, speedily returning you to your terminal)
* `LOLCOMMITS_FORK` fork lolcommit runner (capture command forks to a new
process, speedily returning you to your terminal)
* `LOLCOMMITS_STEALTH` disable notification messages at commit time

Or they can be set via the following arguments in the capture command (located in your repository's `.git/hooks/post-commit` file).
Or they can be set via the following arguments in the capture command (located
in your repository's `.git/hooks/post-commit` file).

* `--device=DEVICE` or `-d DEVICE`
* `--animate=SECONDS` or `-a SECONDS`
Expand All @@ -76,26 +129,46 @@ Or they can be set via the following arguments in the capture command (located i
* `--fork`
* `--stealth`

Use `lolcommits --devices` to list all attached video devices available for capturing. Read how to [configure commit capturing](https://github.com/mroth/lolcommits/wiki/Configure-Commit-Capturing) for more details.
Use `lolcommits --devices` to list all attached video devices available for
capturing. Read how to [configure commit
capturing](https://github.com/mroth/lolcommits/wiki/Configure-Commit-Capturing)
for more details.

### Animated Gif Capturing
Animated gifs (Mac/OSX only) can take a while to generate (depending on the number of seconds you capture and the capabilities of your machine). `ffmpeg` is required and can be installed with brew like so;

Animated gifs (Mac/OSX only) can take a while to generate (depending on the
number of seconds you capture and the capabilities of your machine). `ffmpeg` is
required and can be installed with brew like so;

brew install ffmpeg

To enable, just set the `LOLCOMMITS_ANIMATE` environment variable with the number of seconds to capture.
And like regular image captures you can use the env variables `LOLCOMMITS_DEVICE` and `LOLCOMMITS_DELAY` to change the capture device or delay time (seconds) before capturing.
If you find capturing an animated gif takes too long, try setting the `LOLCOMMITS_FORK=true` env variable.
To enable, just set the `LOLCOMMITS_ANIMATE` environment variable with the
number of seconds to capture. And like regular image captures you can use the
env variables `LOLCOMMITS_DEVICE` and `LOLCOMMITS_DELAY` to change the capture
device or delay time (seconds) before capturing. If you find capturing an
animated gif takes too long, try setting the `LOLCOMMITS_FORK=true` env
variable.

![Example animated lolcommit gif](http://cdn2.usa.bugleblogs.com/blogs/000/000/003/de0eb9aa695.gif "Example animated lolcommit gif")
![Example animated lolcommit
gif](http://cdn2.usa.bugleblogs.com/blogs/000/000/003/de0eb9aa695.gif "Example
animated lolcommit gif")

### Plugins
There are a growing amount of plugins for lolcommits to enable things like Twitter upload, translating your commit messages to lolspeak, etc. Check them out on the [plugins page](https://github.com/mroth/lolcommits/wiki/Configuring-Plugins).

There are a growing amount of plugins for lolcommits to enable things like
Twitter upload, translating your commit messages to lolspeak, etc. Check them
out on the [plugins
page](https://github.com/mroth/lolcommits/wiki/Configuring-Plugins).

## Troubles?
Started a [FAQ](https://github.com/mroth/lolcommits/wiki/FAQ). Or take a read through the the [wiki](https://github.com/mroth/lolcommits/wiki)

Started a [FAQ](https://github.com/mroth/lolcommits/wiki/FAQ). Or take a read
through our [wiki](https://github.com/mroth/lolcommits/wiki)

## Timelapse?
To watch your face as it decays while you program, you can create a quick mpeg of all your lolcommits snapshots (if you have `imagemagick` and `ffmpeg` installed):

To watch your face as it decays while you program, you can create a quick mpeg
of all your lolcommits snapshots (if you have `imagemagick` and `ffmpeg`
installed):

convert `find . -type f -name "*.jpg" -print0 | xargs -0 ls -tlr | awk '{print $9}'` timelapse.mpeg

0 comments on commit 4bdd070

Please sign in to comment.