Giter Site home page Giter Site logo

gitta's Introduction

gitTA

Listen to git hooks, and trigger your functions simply with gitTA.

import gitTA as git

@git.listen('pre-push')
def run_tests(*args, **kwargs):
	import test
    test.all_your_things()
    if test.failed:
    	raise BaseException('abort the push' + test.feedback)

With the above code in main.py, the function run_tests will trigger each time git push is called, with the option to abort the push by raising an error. In fact, you can listen to all local git hooks, including:

  1. pre-commit
  2. commit-msg
  3. post-commit
  4. post-checkout
  5. .... and many more!

With these hooks, its possible to:

  1. Encrypt a commit message after user input
  2. Abort pushes if the branch is master
  3. Correct file-permissions after branch changes
  4. Undo branch changes to always stay on master
  5. Change files after committing
  6. Most anything good or evil... use your powers responsibly

To install gitTA, copy gitTA into a local git repo of your choice. Edit main.py to your liking, then run the install script (located in ./bash/install_githooks.sh), which will move gitTA into your .git directory, overwriting any current hooks with its own. gitTA is local only -- the install script MUST be run each time another user clones your repository. In short, it's a local tool that must be installed by the user; there is no way to have gitTA pre-installed in a repository, short of passing it around in a zipfile or setting it up as a git template. You can, however, include gitTA in your repository as a visible folder and ask that the user run the install script prior to using it.

gitta's People

Contributors

lancekindle avatar

Watchers

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