commit

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package commit contains the logic for interacting with git, commits and github.

Index

Constants

This section is empty.

Variables

View Source
var ItemPrefix = "- "

ItemPrefix is the markdown prefix before each item.

Functions

func ParseGroups

func ParseGroups(logs []string) string

ParseGroups parses the lines in the logs and returns them as a string.

Types

type Git

type Git struct {
	Dir    string
	Remote string
}

Git executes git processes targeted at a directory. If the Dir property is empty, all calls will be on the current folder.

func (Git) Commits

func (g Git) Commits(ctx context.Context, tag1, tag2 string) ([]string, error)

Commits returns the contents of all commits between two tags.

func (Git) LatestTag

func (g Git) LatestTag(ctx context.Context) (string, error)

LatestTag returns the last tag in the repository.

func (Git) PreviousTag

func (g Git) PreviousTag(ctx context.Context, tag string) (string, error)

PreviousTag returns the previous tag of the given tag.

func (Git) Release

func (g Git) Release(ctx context.Context, token, user, repo, tag, desc string) error

Release publishes the release for the user on the repo.

func (Git) RepoInfo

func (g Git) RepoInfo(ctx context.Context) (user, repo string, err error)

RepoInfo returns some information about the repository.

type Group

type Group struct {
	Verb        string
	Subject     string
	Description string
	Breaking    bool
	// contains filtered or unexported fields
}

A Group is a commit with all of its messages.

func GroupFromCommit

func GroupFromCommit(msg string) Group

GroupFromCommit creates a Group object from the given line.

func (Group) DescriptionString

func (g Group) DescriptionString() string

DescriptionString returns a string that is suitable for printing a line in a Group.

func (Group) Section

func (g Group) Section() string

Section returns a printable line for the section.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳