GithubHelp home page GithubHelp logo

gitdown-1's Introduction

gitdown

example of gitdown aborting a commit

gitdown is a script which moderates your git committing activity based on your blood alcohol content (BAC). It uses the DrinkShield for Arduino as a breathalyzer, and a Ruby script as the git hook.

It was built for hackNY's spring 2013 hackathon by Alex Qin (@alexqin) and Geoffrey Litt (@geoffreylitt), and won first place there.

You can watch a demo video of gitdown in action at this Youtube link.

Modes

gitdown has three modes of operation:

  • Normal mode: Only lets you commit with a BAC of less than 0.05%.
  • Krunk mode: Only lets you commit with a BAC of greater than 0.05%.
  • Ball(m)er mode: Only lets you commit with a BAC of between 0.13% and 0.15%.

In Krunk mode and Baller mode, gitdown will mangle your commit messages to make them appear more intoxicated, and will also post your name, current BAC, and the commit message to the official gitdown Tumblr, with a silly related photo attached.

When the "verbose" configuration parameter is turned on as described below, gitdown also gives you helpful facts about your current level of impairment, based on your BAC.

Usage

First, clone the repo and install necessary gems:

git clone https://github.com/noidontdig/gitdown.git
cd gitdown
bundle install

To use the script as a hook for the gitdown repo itself, copy it to the proper location:

cp commit-msg .git/hooks/

Using this project requires an Arduino Uno with the DrinkShield attachment. Open the arduino_gitdown/arduino_gitdown.ino file with the Arduino IDE and load it onto the Arduino.

Then, open the .gitdown config file and edit the three configuration parameters:

  • mode: This should be set to either "normal", "krunk", or "baller", corresponding to the modes described above.
  • port: This should be the device name of the Arduino's USB connection on your machine. This can be found from the Arduino IDE's "Serial Port" Menu. The default value is /dev/tty.usbmodem1421, which happened to work on the Macbook Air used for development.
  • verbose: Set to "true" or "false", depending on whether you want the system to output helpful information about your current BAC level.

Then, you can try editing a file in the gitdown repo and committing the change, to see the script in action.

echo "random change" >> commit-msg
git commit -a -m "messing up the repo"

Depending on the active mode and your BAC, the script will either permit you to or prevent you from committing!

If you want to actually use gitdown in another repository, copy the commit-msg script to that repo's .git/hooks directory, and make sure to copy the .gitdown config file to that repository as well.

gitdown-1's People

Contributors

geoffreylitt avatar noidontdig avatar samgreen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.