All Projects → aaossa → Git Gud

aaossa / Git Gud

Licence: mit
A simple git commit checker

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Git Gud

Craft Do Forge Recipe
Digital Ocean / Forge Recipe for CraftCMS websites
Stars: ✭ 24 (-68.83%)
Mutual labels:  bash-script
Simple Sh Datascience
A collection of Bash scripts and Dockerfiles to install data science Tool, Lib and application
Stars: ✭ 32 (-58.44%)
Mutual labels:  bash-script
Bashrc
System to organize and synchronize bash startup files and other files in your home directory
Stars: ✭ 52 (-32.47%)
Mutual labels:  bash-script
Add Copyright
This is a Script to Automate adding the Copyright text to one or more source files Recursively.
Stars: ✭ 27 (-64.94%)
Mutual labels:  bash-script
Bashmultitool
A library for bash shell program containing useful functions. Can be imported into scripts to create colourful and functional scripts and TUIs.
Stars: ✭ 27 (-64.94%)
Mutual labels:  bash-script
House
Proof of Concept and Research repository.
Stars: ✭ 37 (-51.95%)
Mutual labels:  bash-script
Deploy Docker Swarm
Deploy scripts for docker-swarm.
Stars: ✭ 17 (-77.92%)
Mutual labels:  bash-script
Bazel and compilecommands
Add compile_commands.json to your C++ Bazel Project
Stars: ✭ 62 (-19.48%)
Mutual labels:  bash-script
Cfhookbash
Cloudflare hook bash for dehydrated - DNS-01 Challenge Let's Encrypt
Stars: ✭ 28 (-63.64%)
Mutual labels:  bash-script
Fuckjack
FUCK JACK!
Stars: ✭ 50 (-35.06%)
Mutual labels:  bash-script
Ubuntu Setup
script to configure fresh ubuntu install, or to update existing install
Stars: ✭ 8 (-89.61%)
Mutual labels:  bash-script
Vault712
Grin installer and wallet viewer
Stars: ✭ 15 (-80.52%)
Mutual labels:  bash-script
Padd
PADD (formerly Chronometer2) is a more expansive version of the original chronometer.sh that is included with Pi-Hole. PADD provides in-depth information about your Pi-hole.
Stars: ✭ 1,011 (+1212.99%)
Mutual labels:  bash-script
Work Dummy
Ever needed to faff or pretend to be seriously at work? This repository hosts a powershell script that'd make anyone think you definitely bursting your ass solving problems.
Stars: ✭ 26 (-66.23%)
Mutual labels:  bash-script
Rsync
In the process of being transitioned to a node.js action.
Stars: ✭ 53 (-31.17%)
Mutual labels:  bash-script
Wsl Docker Git Setup
Shell script to configure Windows Subsystem for Linux (WSL) & Ubuntu on Windows to use docker and docker-compose as well as a git-enabled prompt
Stars: ✭ 23 (-70.13%)
Mutual labels:  bash-script
Search Docker Registry V2 Script.1.0
view-private-registry is a simple bash script for listing images in a private registry v2, docker search registry-v2
Stars: ✭ 34 (-55.84%)
Mutual labels:  bash-script
Changelog Ci
Changelog CI is a GitHub Action that generates changelog, Then the changelog is committed and/or commented to the release Pull request.
Stars: ✭ 68 (-11.69%)
Mutual labels:  bash-script
Wine Origin Updater
Updater for Origin in Wine
Stars: ✭ 57 (-25.97%)
Mutual labels:  bash-script
Run script
Run shell scripts in rust.
Stars: ✭ 42 (-45.45%)
Mutual labels:  bash-script

git-gud

FOSSA Status

A simple git commit checker. I often use a commit message template I created a while ago, and I wanted to make sure that everything was in the right place after writing a commit, that's why this script exists. Use it if you want to git gud too. To add this custom git command to git, just place the file in a folder that's in your path (a.k.a PATH). You can setup git-gud as custom command or setup git-gud as post-commit hook.

Usage

You can use the same commit limmits as in git log: --author, --number, --until, --before, and more. (git-log docs). Some basic examples:

# Check last commit
$ git gud

# Check <number> commits in the current branch
$ git gud -<number>
$ git gud -n <number>
$ git gud --max-count=<number>

# Check commits in another branch
$ git gud <branch>
$ git gud <branch> -<number>
$ git gud -n <number> <branch>

# And... a sample output
$ git gud

Checking... afaeaf5
> OK: Author name format is valid (Antonio Ossa)
> OK: Author email format is valid ([email protected])
> OK: Commiter name format is valid (Antonio Ossa)
> OK: Commiter email format is valid ([email protected])
> ERROR: Subject is too long (59 > 50)
> ERROR: Body is empty (0 == 0)
> OK: Body includes comment (2 > 0)
> OK: 'Signed-off-by' line is not empty (42 > 0)
> OK: 'Signed-off-by' line has author information
> WARNING: Signature is not valid (Status: N)

Checks

  • [x] Commit author name is in a valid format ( Antonio Ossa)
  • [x] Commit author name is the same in your config file
  • [x] Commit author email is in a valid format ([email protected])
  • [x] Commit author email is the same in your config file
  • [x] Commit subject message uses a maximum of 50 characters
  • [x] Commit body message is not empty
  • [x] Commit body message lines use a maximum of 72 characters
  • [x] Commit body message has lines with comments (i.e. not "Signed-off-by: ...")
  • [x] Commit body message has a "Signed-off-by: ..." line (Signed-off-by: Antonio Ossa <[email protected]>)
  • [x] Commit signature is "good"

Template

This is the template I use. You can find it as .gitmessage in this repo and install it following these instructions. The script assumes that you're following these conventions, but you can use your own template if you want (or none) and customize the checker too! That's why is OSS ❤️:

# |<----  Using a Maximum Of 50 Characters  ---->|
# If this commit is applied, it will...
# Examples of imperative mood: Refactor X, Update Y, Remove Z
Subject

# |<----   Try To Limit Each Line to a Maximum Of 72 Characters   ---->|
# What/why/how was this change made?

# Any references to relevant tickets, articles, resources, etc?
# Example: GitHub issue #23

# Something more?
# Reported-by: A person or @somebody
Signed-off-by: Antonio Ossa <[email protected]>

# (❤️ emoji? http://emoji.muan.co/)

To do

  • [X] Wiki: How to use template
  • [X] Instructions: Use git-gud as custom command
  • [X] Instructions: Use git-gud as post-commit hook
  • [x] Script: Allow check multiple commits (git gud -n 10)
  • [x] Script: Allow check on another branch (git gud branch)
  • [ ] Script: Check imperative mood in subject
  • [ ] Script: Add flags about output verbosity (--full/current, --warn/warnings+errors, --error/errors only)

License

This software is released under the MIT License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].