Code Monkey home page Code Monkey logo

git-hooks's Introduction

How to use git hooks

Hello. Thank you for being here. This repository belongs to the youtube video How to use GIT HOOKS for better COMMITS. If you haven't seen it, please consider watching the video, to get a better understanding of this code.

How to use GIT HOOKS for better COMMITS

Content

The following files are included:

File Description
commit-msg.py A commit-msg git-hook implementation to check the commit message for 5 of the 7 rules for a proper commit message (see below) with a Phillips Hue integration.
install_hooks.sh A shell script to install the hook into this repository to try it out.
requirements.txt Python library requirements to use with pip.

How to use this hook

If you just want to play around with this project you can run the install_hooks.sh script to install this hook in your local clone of this repository and try out some commits. Make sure that you add your Hue Bridge IP and Hue Lamp Name to the commit-msg.py script as well.

The Phillips Hue integration is not fail-safe, so I added a switch to activate the indication as soon as all necessary information is provided. If you want to use the Phillips Hue integration set HUE_ACTIVE to True after you defined your bridge's IP address and lamp name.

If you plan to use this in another repo, you can copy the hook scripts and the install_hooks.sh to it and check it distribute it to your teammates. Make sure to also add a little paragraph to your README.md, to let them know about the new hooks.

Requirements

The commit-msg.py hook uses the phue library. Please click here for more details.

Seven rules for a great commit message

  1. Separate subject from the body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how

Contribution

New ideas for hooks are always welcome. Please fork and create a pull request if you have some creative additions.

git-hooks's People

Contributors

thekie avatar rmkane 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.