git

package
v0.0.0-...-f318275 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unmodified         = gogit.Unmodified
	Untracked          = gogit.Untracked
	Modified           = gogit.Modified
	Added              = gogit.Added
	Deleted            = gogit.Deleted
	Renamed            = gogit.Renamed
	Copied             = gogit.Copied
	UpdatedButUnmerged = gogit.UpdatedButUnmerged
)

Variables

This section is empty.

Functions

func GetFileStatus

func GetFileStatus(status StatusCode) string

GetFileStatus returns a string representation of a git status code

Types

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func OpenRepository

func OpenRepository(path string, cfg config.GitConfig) (*Repository, error)

func (*Repository) CommitObject

func (r *Repository) CommitObject(hash plumbing.Hash) (*object.Commit, error)

func (*Repository) CreateTag

func (r *Repository) CreateTag(ctx context.Context, tagName, message string) error

CreateTag creates a new tag at HEAD with the given name and message

func (*Repository) FindLastVersionTag

func (r *Repository) FindLastVersionTag() (string, error)

FindLastVersionTag locates the most recent semantic version tag

func (*Repository) GetAllCommitMessages

func (r *Repository) GetAllCommitMessages() ([]string, error)

GetAllCommitMessages returns all commit messages in the repository

func (*Repository) GetChangeHistory

func (r *Repository) GetChangeHistory(tag string) (string, error)

GetChangeHistory retrieves commit messages since a specific tag or all commits

func (*Repository) GetChangesBetween

func (r *Repository) GetChangesBetween(from, to plumbing.Hash) ([]string, error)

GetChangesBetween returns commit messages between two commits

func (*Repository) GetChangesSinceTag

func (r *Repository) GetChangesSinceTag(tag string) ([]string, error)

GetChangesSinceTag returns commit messages between the specified tag and HEAD

func (*Repository) GetCommitMessagesSince

func (r *Repository) GetCommitMessagesSince(hash plumbing.Hash) ([]string, error)

GetCommitMessagesSince returns all commit messages since a given hash

func (*Repository) GetCurrentBranch

func (r *Repository) GetCurrentBranch() (string, error)

func (*Repository) GetFileDiff

func (r *Repository) GetFileDiff(path string) (string, error)

func (*Repository) GetFilesToCommit

func (r *Repository) GetFilesToCommit() ([]string, error)

func (*Repository) GetUserConfig

func (r *Repository) GetUserConfig() (string, string, error)

getUserConfig returns the user's name and email from git config.

func (*Repository) Head

func (r *Repository) Head() (*plumbing.Reference, error)

func (*Repository) MakeCommit

func (r *Repository) MakeCommit(ctx context.Context, message string, filesToAdd []string) error

MakeCommit creates a new commit with the given message and files

func (*Repository) References

func (r *Repository) References() (storer.ReferenceIter, error)

func (*Repository) ShouldIgnoreFile

func (r *Repository) ShouldIgnoreFile(path string, ignorePatterns []string, includeGitignore bool) bool

func (*Repository) StageFiles

func (r *Repository) StageFiles(files []string) error

StageFiles stages the given files in the repository

func (*Repository) Status

func (r *Repository) Status() (gogit.Status, error)

type StatusCode

type StatusCode = gogit.StatusCode

Jump to

Keyboard shortcuts

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