git

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGitDir

func FindGitDir() (string, error)

FindGitDir returns the path to the .git directory for the current repository. If not in a git repository, returns an error.

func FindRepoRoot added in v0.4.5

func FindRepoRoot() (string, error)

FindRepoRoot returns the absolute path to the repository root (work tree)

func GetEffectiveHooksDir added in v0.4.5

func GetEffectiveHooksDir() (string, error)

GetEffectiveHooksDir returns the directory where hooks should be installed. It respects `core.hooksPath` (e.g., Husky's .husky directory). When unset, it falls back to <gitDir>/hooks.

func GetScriptPath

func GetScriptPath() (string, error)

GetScriptPath returns the absolute path to the scripts directory

func InstallHuskyPostCommitHook added in v0.4.5

func InstallHuskyPostCommitHook(huskyDir string) error

InstallHuskyPostCommitHook installs or augments a Husky post-commit hook without overwriting existing Husky logic.

func InstallHuskyPrepareCommitMsgHook added in v0.4.5

func InstallHuskyPrepareCommitMsgHook(huskyDir string) error

InstallHuskyPrepareCommitMsgHook installs or augments a Husky prepare-commit-msg hook without overwriting existing Husky logic. It appends a noidea block if not already present.

func InstallPostCommitHook

func InstallPostCommitHook(hooksDir string) error

InstallPostCommitHook installs the post-commit hook script in the specified hooks directory. The hook will call 'noidea moai' after each commit to show feedback about the commit message.

func InstallPrepareCommitMsgHook

func InstallPrepareCommitMsgHook(hooksDir string) error

InstallPrepareCommitMsgHook installs the prepare-commit-msg hook for commit message suggestions. This hook runs before Git creates a commit and offers AI-generated commit message suggestions based on the staged changes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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