GithubHelp home page GithubHelp logo

my-git-hooks's Introduction

Installation

Download the git-hooks wrapper script from https://github.com/icefox/git-hooks and install it in your $PATH, e.g. by

wget https://raw.github.com/icefox/git-hooks/master/git-hooks -O ~/bin/git-hooks; chmod u+x ~/bin/git-hooks

Then install this repository in ~/.git_hooks:

git clone https://github.com/sercxanto/my-git-hooks ~/.git_hooks
git config --global init.templatedir ~/.git_hooks/_templatedir

Now new or freshly cloned repositories contain the hooks defined in _templatedir (which point to the git-hooks wrapper script). To make use git-hooks in already existing repositories run git-hooks --install in each of these:

find ~/src -name ".git" -type d -exec bash -c 'cd {}; git-hooks --install' \;

change_uuid.py hook

Inspired by gerrits commitmsg hook. But unlike the gerrit hook this script generates purely random uuids independed of the commit history.

You can track changes across cherry-picks, rebases and merges.

change_uuid also helps to track changes in a project consisting of multiple repositories (cross repo changes).

To accomplish this all identical commit messages of the last 10 minutes share the same uuid. There might be corner cases where this does not work, e.g. when commiting to two different projects with just "git commit -m bugfix".

record_commit.sh

Ever wondered on what you worked the past three weeks? Or you know exactly you figured out a solution to a specific problem but can't remember in which project it was?

Then maybe this hook can help you. It simply stores a copy of each commit message in ~/.git_hooks/_data/record_commit/. year/month subfolder are created automatically and the file names contain the timestamp, repository and the short commit id to make them distinct.

my-git-hooks's People

Contributors

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