libgit

package
v0.0.0-...-2491e1c Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Date          string
	Subject       string
	Author        string
	Hash          string
	ParentHashes  []string
	LocalBranches []string
}

type Git

type Git interface {
	ValidateGitInstall() error
	IsRepoClean() (bool, error)
	GetRemote() (Remote, error)
	GetRootDir() (string, error)
	CommitFixup(commitHash string, add bool) (string, error)
	CommitEmpty(msg string) error
	GetMergedBranches(ref string) ([]string, error)
	GetCurrentBranch() (string, error)
	GetShortCommitHash(branch string) (string, error)
	PushForceWithLease(branchName string) (string, error)
	Rebase(branch string, opts RebaseOpts) (string, error)
	CreateBranch(name string, startPoint string) error
	DeleteBranchIfExists(name string) error
	Checkout(name string) error
	LogAll(notReachableFrom string) (Log, error)
	LogOneline(from string, to string) error
}

func New

func New() Git

type Log

type Log struct {
	// Commits are ordered from oldest to newest
	Commits []Commit
}

type RebaseOpts

type RebaseOpts struct {
	Interactive bool
	Autosquash  bool
	KeepBase    bool
	UpdateRefs  bool
}

type Remote

type Remote struct {
	Kind    githost.Kind
	URLPath string // e.g. raymondji/git-stack-cli
}

type Upstream

type Upstream struct {
	Remote     string
	BranchName string
}

Jump to

Keyboard shortcuts

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