info

package
v0.0.0-...-832881f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionSucceeded = 0
	ActionSkipped   = 1
	ActionFailed    = 2
)
View Source
const (
	Version              = "1.4.0"
	ReleaseDate          = "2025-07-25"
	Config               = "captainhook.json"
	MinRequiredInstaller = "1.0.4"
	Executable           = "captainhook"
)
View Source
const (
	ArgCommitMsgFile = "message-file"
	ArgGitCommand    = "git-command"
	ArgHash          = "hash"
	ArgPreviousHead  = "previous-hash"
	ArgMode          = "mode"
	ArgNewHead       = "new-head"
	ArgSquash        = "squash"
	ArgTarget        = "target"
	ArgURL           = "url"
	ArgCommand       = "command"
)

Names of all hook arguments to map them from position to name

View Source
const (
	PreCommit        = "pre-commit"
	PrePush          = "pre-push"
	CommitMsg        = "commit-msg"
	PrepareCommitMsg = "prepare-commit-msg"
	PostCommit       = "post-commit"
	PostMerge        = "post-merge"
	PostCheckout     = "post-checkout"
	PostRewrite      = "post-rewrite"
	PostChange       = "post-change"
)

Variables

View Source
var (
	HookArgs = map[string][]string{
		CommitMsg:        {ArgCommitMsgFile},
		PostCheckout:     {ArgPreviousHead, ArgNewHead, ArgMode},
		PostCommit:       {},
		PostMerge:        {ArgSquash},
		PostRewrite:      {ArgGitCommand},
		PreCommit:        {},
		PrePush:          {ArgTarget, ArgURL},
		PrepareCommitMsg: {ArgCommitMsgFile, ArgMode, ArgHash},
	}
)

Functions

func AllHookArguments

func AllHookArguments() []string

AllHookArguments returns a slice of all available arguments It is used to detect if a placeholder config is correct

func GetNativeHooks

func GetNativeHooks() []string

GetNativeHooks is returning all hooks native to git

func GetValidHooks

func GetValidHooks() []string

GetValidHooks is returning all hooks supported by CaptainHook git native and virtual ones.

func GetVirtualHooks

func GetVirtualHooks() []string

GetVirtualHooks is retuning all virtual hooks provided by CaptainHook

func HookArguments

func HookArguments(hook string) []string

HookArguments returns the arguments for a given hook

func VirtualHook

func VirtualHook(hook string) (string, bool)

VirtualHook returns the virtual hook triggered by a given native hook Examples: - post-checkout triggers post-change - post-merge triggers post-change ...

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL