hooks

package
v1.108.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HookMarker is the comment line embedded in managed hook scripts.
	HookMarker = "# chainloop-trace-managed"
)

Variables

This section is empty.

Functions

func Install

func Install(gitDir string, skipPrePush bool) (string, error)

Install installs git hooks for trace automation. gitDir may be either the main repo's .git or a per-worktree gitdir (.git/worktrees/<name>); the resolved hooks directory is returned so callers can log it.

Hooks are always written to the *common* hooks dir, since git only reads hooks/ from the shared .git/ even when invoked from a linked worktree.

Pass skipPrePush=true to install only commit-msg and post-commit; used by trace run, which drives the attestation push itself.

func IsInstalled

func IsInstalled(gitDir string, skipPrePush bool) bool

IsInstalled reports whether the managed hooks are present and carry the chainloop marker. Pass skipPrePush=true to exclude pre-push from the check, matching what trace run installs.

gitDir may point at a per-worktree gitdir; the common hooks dir is resolved internally (see resolveHooksDir).

func Uninstall

func Uninstall(gitDir string) (string, error)

Uninstall removes git hooks installed by trace. gitDir semantics match Install.

Types

This section is empty.

Jump to

Keyboard shortcuts

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