Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-graft

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-graft

git hook generator that prepends branch name to commit message

  • 0.0.14-alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

git-graft

oclif Version Downloads/week License

NPX CLI tool that generates a configurable Git Hook that prepends branch name patterns to commit messages.

Features:

  • Generated Git Hook
  • Hook is a bin file running Node & no dependencies
  • Configurable git-graft.json
  • Validates the commit message and branch
  • Usage
  • Commands

WIP:

  • Zero Config -- following GitFlow DevOps best practices.

Usage

$ npx git-graft (-v|--version|version)
git-graft/0.0.0 linux-x64 node-v14.16.1
$ npx git-graft --help
Main Usage
  $npx git-graft [COMMAND]
...

Commands

Init

Git Graft currently only has one command for generating the Git Hook and configuration file.

example: npx git-graft init

The prompts will be used to construct the configuration file and ask to modify permissions to allow for execution of the generated Git Hook. Without permission to execute the Git Hook cannot work.

TBD:

Doctor

  • Will run permissions check on Git Graft Hook
  • Will run unit tests on Git Graft Hook code

Configuration

The init generates a git-graft.json that has properties for a configurable Git Hook. Configuration the patterns to validate the branch and resulting prepended commit message with branch information.

branchTypes:

RegExp List required -- Refers to GitFlows from DevOps best practices. Git Graft Hook will wrap the list in () and the constructor includes the forward slash & escape \/ example

branchPattern:

RegExp required -- Refers to the code/ticket and name of the branch following the branchType. example

ticketTypes:

string required -- Refers to the ticket code types, for example JIRA will use TICKETTYPE-{NUMBERS}. The Git Hook will use this config to construct a RegExp for the prepending to commit messages.

regExFlag:

RegExp optional -- Flags to pass into RegEx constructors. Default: gim

ticketOnly:

boolean optional -- Used to determine if ticket/code or whole branch should used. Default: true


RegEx Examples:

Zero Config RegExp Usage - https://regex101.com/r/UKwIK2/1
branchPattern - https://regex101.com/r/ewym8B/1
branchTypes - https://regex101.com/r/KNZio4/1

Keywords

FAQs

Package last updated on 13 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc