gitutil

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 3 Imported by: 3

Documentation

Overview

Package gitutil provides convenient interfaces for operating git.

Dependency: git needs to be installed locally

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyGitTag = errors.New("empty tag")

Functions

func GetHeadHash

func GetHeadHash() (sha string, err error)

func GetHeadHashShort

func GetHeadHashShort() (sha string, err error)

func GetLatestTag

func GetLatestTag() (string, error)

func GetLatestTagFromLocal

func GetLatestTagFromLocal() (tag string, err error)

func GetLatestTagFromRemote

func GetLatestTagFromRemote() (tag string, err error)

get latest tag from remote, the fitting git clone depth is 1

func GetRemoteURL added in v0.2.3

func GetRemoteURL() (string, error)

get remote url

func GetTagCommitSha

func GetTagCommitSha(tag string) (sha string, err error)

func GetTagCommitShaFromLocal

func GetTagCommitShaFromLocal(tag string) (sha string, err error)

func GetTagCommitShaFromRemote

func GetTagCommitShaFromRemote(_ string) (string, error)

get tag commit sha from remote, the fitting git clone depth is 1

func GetTagList

func GetTagList() (tags []string, err error)

func GetTagListFromRemote added in v0.2.3

func GetTagListFromRemote(remoteURL string, reverse bool) (tags []string, err error)

func IsDirty

func IsDirty() (dirty bool, err error)

func IsHeadAtTag

func IsHeadAtTag(tag string) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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