ManolloGuedes / Git-hooks

This hook project is part of a 2 articles tutorial about git hooks. In this tutorial we learn how to use git hooks to prevent commit duplicates and to analyze commit messages using data from Jira API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git Hooks

This project was made as part of two articles about Git Hooks. With this tutorial, two Git Hooks was created: post-rewrite and commit-msg.

The post-rewrite hook gives us the capabillity to discover duplicate commits.

The commit-message hook creates an acreates a commit message analysis flow that uses Jira's API data as input.

Articles

Getting Started

The step-by-step installation instructions of each hook are inside of its folder on README.md files.

You basically needs:

  • download both commit/src/commit-msg, commit/src/commit-verify.py, install.sh, and requirements.txt files to use commit-msg hook.
    • execute the install.sh file to install all requirentements present inside requirements.txt file
  • download rebase/src/post-rewrite file to use post-rewrite hook.
  • put these files inside the .git/hooks folder present in your project folder.
  • grant execution permission to both post-rewrite, commit-msg and commit-verify.py files.

Built With

  • Git Hooks - Git Hooks terminology
  • Shell Script - programming language used to create both hooks
  • Python 3 - programming language used to create the validation commit message program called by the commit-msg hook
  • Jira API - Atlassian API to access Jira's information
  • requests - HTTP library for Python

About

This hook project is part of a 2 articles tutorial about git hooks. In this tutorial we learn how to use git hooks to prevent commit duplicates and to analyze commit messages using data from Jira API.


Languages

Language:Python 77.4%Language:Shell 22.6%