{"modulePath":"github.com/chainloop-dev/chainloop","version":"v1.140.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package hooks\n\n## Constants\n\n```go\nconst (\n\t// HookMarker is the comment line embedded in managed hook scripts.\n\tHookMarker = \"# chainloop-trace-managed\"\n)\n```\n\n## Functions\n\n```go\nfunc Install(gitDir string, skipPrePush bool) (string, error)\n```\nInstall installs git hooks for trace automation. gitDir may be either the main repo's .git or a per-worktree gitdir (.git/worktrees/\\\u003cname\u003e); the resolved hooks directory is returned so callers can log it.\n\nHooks are always written to the \\*common\\* hooks dir, since git only reads hooks/ from the shared .git/ even when invoked from a linked worktree.\n\nPass skipPrePush=true to install every hook except pre-push; used by trace run, which drives the attestation push itself.\n\n```go\nfunc IsInstalled(gitDir string, skipPrePush bool) bool\n```\nIsInstalled reports whether the managed hooks are present and match the scripts this CLI writes. A managed script written by an older CLI reports false, so the caller reinstalls it. Pass skipPrePush=true to exclude pre-push from the check, matching what trace run installs.\n\ngitDir may point at a per-worktree gitdir; the common hooks dir is resolved internally (see resolveHooksDir).\n\n```go\nfunc Uninstall(gitDir string) (string, error)\n```\nUninstall removes git hooks installed by trace. gitDir semantics match Install.\n\n","path":"github.com/chainloop-dev/chainloop/app/cli/internal/trace/hooks","name":"hooks","synopsis":"","isRedistributable":true}
