chglog

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 16 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

chlog

fork

Documentation

Overview

Package chglog contains the public API for working with a changlog.yml file

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCommits = errors.New("no commits found for this entry")

ErrNoCommits happens when no commits are found for a given entry.

Functions

func CommitsBetween

func CommitsBetween(gitRepo *git.Repository, start, end plumbing.Hash, excludeMergeCommits bool) (commits []*object.Commit, err error)

CommitsBetween return the list of commits between two commits.

func DebTemplate

func DebTemplate() (*template.Template, error)

DebTemplate load default debian template.

func FormatChangelog

func FormatChangelog(pkgLogs *PackageChangeLog, tpl *template.Template) (string, error)

FormatChangelog format pkgLogs from a text/template.

func GitHashFotTag

func GitHashFotTag(gitRepo *git.Repository, tagName string) (hash plumbing.Hash, err error)

GitHashFotTag return the git sha for a particular tag.

func GitRepo

func GitRepo(gitPath string, detectDotGit bool) (*git.Repository, error)

GitRepo open a GitRepo to use to build the changelog from.

func LoadTemplateData

func LoadTemplateData(data string) (*template.Template, error)

LoadTemplateData load a template from string with all of the sprig.TxtFuncMap loaded.

func RPMTemplate

func RPMTemplate() (*template.Template, error)

RPMTemplate load default RPM template.

func ReleaseTemplate

func ReleaseTemplate() (*template.Template, error)

ReleaseTemplate load default release template.

func RepoTemplate

func RepoTemplate() (*template.Template, error)

RepoTemplate load default repo template.

Types

type ChangeLog

type ChangeLog struct {
	ChangeLogOverridables `yaml:",inline"`
	Semver                string           `yaml:"semver"`
	Date                  time.Time        `yaml:"date"`
	Packager              string           `yaml:"packager"`
	Notes                 *ChangeLogNotes  `yaml:"notes,omitempty"`
	Changes               ChangeLogChanges `yaml:"changes,omitempty"`
}

ChangeLog a single changelog entry.

func CreateEntry

func CreateEntry(date time.Time, version fmt.Stringer, owner string, notes *ChangeLogNotes, deb *ChangelogDeb, commits []*object.Commit, useConventionalCommits bool) (changelog *ChangeLog)

CreateEntry create a ChangeLog object.

type ChangeLogChange

type ChangeLogChange struct {
	Commit string `yaml:"commit"`
	Note   string `yaml:"note"`
	// Author is the original author of the commit.
	Author *User `yaml:"author,omitempty"`
	// Committer is the one performing the commit, might be different from
	// Author.
	Committer          *User                                   `yaml:"committer,omitempty"`
	ConventionalCommit *conventional_commit.ConventionalCommit `yaml:"conventional_commit,omitempty"`
}

ChangeLogChange an individual change.

type ChangeLogChanges

type ChangeLogChanges []*ChangeLogChange

ChangeLogChanges list of individual changes.

type ChangeLogEntries

type ChangeLogEntries []*ChangeLog

ChangeLogEntries list of ChangeLog entries.

func AddEntry

func AddEntry(
	gitRepo *git.Repository,
	version fmt.Stringer,
	owner string,
	notes *ChangeLogNotes,
	deb *ChangelogDeb,
	current ChangeLogEntries,
	useConventionalCommits bool,
	excludeMergeCommits bool,
) (cle ChangeLogEntries, err error)

AddEntry add a ChangeLog entry to an existing ChangeLogEntries that.

func InitChangelog

func InitChangelog(gitRepo *git.Repository, owner string, notes *ChangeLogNotes, deb *ChangelogDeb, useConventionalCommits bool, excludeMergeCommits bool) (cle ChangeLogEntries, err error)

InitChangelog create a new ChangeLogEntries from a git repo.

func Parse

func Parse(file string) (entries ChangeLogEntries, err error)

Parse parse a changelog.yml into ChangeLogEntries.

func (ChangeLogEntries) Len

func (c ChangeLogEntries) Len() int

Len returns the length of a collection. The number of Version instances on the slice.

func (ChangeLogEntries) Less

func (c ChangeLogEntries) Less(i, j int) bool

Less is needed for the sort interface to compare two Version objects on the slice. If checks if one is less than the other.

func (*ChangeLogEntries) Save

func (c *ChangeLogEntries) Save(file string) (err error)

Save save ChangeLogEntries to a yml file.

func (ChangeLogEntries) Swap

func (c ChangeLogEntries) Swap(i, j int)

Swap is needed for the sort interface to replace the Version objects at two different positions in the slice.

type ChangeLogNotes

type ChangeLogNotes struct {
	Header *string `yaml:"header,omitempty"`
	Footer *string `yaml:"footer,omitempty"`
}

ChangeLogNotes contains a potential header/footer string for output formatting.

type ChangeLogOverridables

type ChangeLogOverridables struct {
	Deb *ChangelogDeb `yaml:"deb,omitempty"`
}

ChangeLogOverridables contains potential format specific fields.

type ChangelogDeb

type ChangelogDeb struct {
	Urgency       string   `yaml:"urgency"`
	Distributions []string `yaml:"distributions"`
}

ChangelogDeb contains fields specific to the debian changelog format https://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog

type PackageChangeLog

type PackageChangeLog struct {
	Name    string           `yaml:"name"`
	Entries ChangeLogEntries `yaml:"entries"`
}

PackageChangeLog used for the formatting API.

type User

type User struct {
	// Name represents a person name. It is an arbitrary string.
	Name string `yaml:"name"`
	// Email is an email, but it cannot be assumed to be well-formed.
	Email string `yaml:"email"`
}

User is used to identify who created a commit or tag.

Directories

Path Synopsis
cmd
chglog command
Package main contains the main nfpm cli source code.
Package main contains the main nfpm cli source code.
pkg
commands
Package commands contain the commands for the cli
Package commands contain the commands for the cli

Jump to

Keyboard shortcuts

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