git

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package git provides Git integration for OpenPass vaults.

Index

Constants

View Source
const DefaultCommitTemplate = "Update from OpenPass"

DefaultCommitTemplate is the default commit message template

View Source
const DefaultGitignoreContent = `` /* 215-byte string literal not displayed */

DefaultGitignoreContent is the default .gitignore content for OpenPass vaults

Variables

This section is empty.

Functions

func AutoCommit

func AutoCommit(vaultDir string, message string) error

AutoCommit performs a simple auto-commit with the given message

func AutoCommitAndPush

func AutoCommitAndPush(vaultDir string, message string, autoPush bool) error

AutoCommitAndPush performs auto-commit and optionally auto-push

func AutoCommitWithOptions

func AutoCommitWithOptions(vaultDir string, opts CommitOptions) error

AutoCommitWithOptions performs an auto-commit with the given options

func CreateGitignore

func CreateGitignore(vaultDir string) error

CreateGitignore creates a .gitignore file in the vault directory

func Init

func Init(vaultDir string) error

func Pull

func Pull(vaultDir string) error

func Push

func Push(vaultDir string) error

Types

type Commit

type Commit struct {
	Hash    string
	Author  string
	Date    time.Time
	Message string
}

func Log

func Log(vaultDir string, path string, limit int) ([]Commit, error)

type CommitOptions

type CommitOptions struct {
	Message  string
	Template string
	Author   string
	Email    string
}

CommitOptions holds options for committing

type PushError

type PushError struct {
	Cause   error
	Message string
}

PushError represents an error that occurred during push

func (*PushError) Error

func (e *PushError) Error() string

func (*PushError) Unwrap

func (e *PushError) Unwrap() error

type PushResult

type PushResult struct {
	Error     error
	RemoteURL string
	Success   bool
	Skipped   bool
	HasRemote bool
}

PushResult represents the result of a push operation

func PushWithResult

func PushWithResult(vaultDir string) PushResult

PushWithResult pushes to origin and returns detailed result

Jump to

Keyboard shortcuts

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