Documentation ¶
Index ¶
- func Add(path string, args ...string) error
- func Changed(repository string, commit string, paths ...string) ([]string, error)
- func Changes(repository string, from, to string, paths ...string) ([]string, error)
- func Commit(path, message string) error
- func Git(path string, arguments ...string) (output []byte, err error)
- func LsTree(repository, tree string, path ...string) ([]string, error)
- func Tag(path, tag, message string, commit string) error
- func Tags(path string) ([]string, error)
- func ToModuleTag(modulePath string, version string) (string, error)
- type ModuleTags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Changes ¶
Changes outputs a list of files for the repository that have changed at the given paths between from and to commit-like references. If no paths are provided then all files that changed between the two tree-ish (commit or tag) references are returned.
func Commit ¶
Commit commits the staged contents in the specified repository path using the provided message.
func Git ¶
Git executes the git with the provided arguments. The command is executed in the provided directory path.
func LsTree ¶
LsTree lists the files present in the tree-ish for the repository. An optional set of one or more paths can be provided to limit the output file paths.
func Tag ¶
Tag invokes git-tag is the specified path, creating the given annotated tag at the given commit with the provided message.
func ToModuleTag ¶
ToModuleTag converts the relative module path and semver version string to a git tag that can be used to identify the module version. For example:
Path: . Version: v1.2.3 => v1.2.3 Path: service/s3 Version: v0.2.3 => service/s3/v0.2.3 Path: service/s3 Version: v1.2.3 => service/s3/v1.2.3 Path: service/s3/v2 Version: v2.2.3 => service/s3/v2.2.3 Path: service/s3/v3 Version: v2.2.3 => error
Types ¶
type ModuleTags ¶
ModuleTags is a map of module paths to a slice of tagged Go semver versions. Root module tags will be placed in the map at ".". Major versions > v1 will be added to the map with the semver major version appended to the module path.
Versions will be sorted in the slice from highest to lowest by comparing the values following semantic versioning rules.
Example:
. => ["v1.2.3", "v1.0.0"] v2 => ["v2.0.0"] sub/module => ["v1.2.3"] sub/module/v2 => ["v2.2.3"]
func ParseModuleTags ¶
func ParseModuleTags(tags []string) ModuleTags
ParseModuleTags parses a list of Git tags into a set of ModuleTags. Tags that are not semvar compliant with Go will be ignored.
func (ModuleTags) Add ¶
func (r ModuleTags) Add(tag string) bool
Add adds the given tag to the ModuleTags