commitmsg

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 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.

Documentation

Overview

Package commitmsg holds the rules of a MacPorts commit message that more than one part of dockhand writes by: the "<port>: <what changed>" subject, and dockhand's attribution line. It depends only on the build's version, so the editor, tidy, and the pull-request body read one rule.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attributed

func Attributed(message string) bool

Attributed reports whether a commit message carries dockhand's attribution line, as tidy writes it on a commit of dockhand's own edits.

func Body added in v0.5.0

func Body(message string) string

Body is a message's text after its subject, less its trailer paragraph.

func Build

func Build(message string) (string, bool)

Build is the build a message's Generated-By names, by its tag: "v0.0.0-20260924.0.0.20260928175309-2bbcfdb76480", or "devel+1a2b3c4d5e6f.modified". A message without the line names none.

func Compose added in v0.5.0

func Compose(subject, text string, combined, tickets []string, generated bool) string

Compose writes a commit's message as tidy proposes it: a subject, a body, and the trailers the combined commits' messages carried, Closes:, then See:, then the others, then dockhand's Generated-By: when dockhand wrote the edit, an earlier one left out. It's tidy's composer, here beside the rules it writes to, where engine/tidy.go held it (the code-organization review's finding 9).

tickets are Trac tickets the branch was told it closes, by number, each a Closes: trailer with its URL (TicketURL), once whatever else names it.

func GeneratedBy

func GeneratedBy() string

GeneratedBy is the trailer naming the build that generated a commit: "Generated-By: Dockhand devel+1a2b3c4d5e6f (https://github.com/herbygillot/dockhand)". It is plain text; a commit message is not Markdown.

func IsAttribution

func IsAttribution(line string) bool

IsAttribution reports whether a message line is dockhand's trailer.

func IsAttributionTrailer added in v0.5.0

func IsAttributionTrailer(line string) bool

IsAttributionTrailer reports whether a message line attributes the commit, rather than saying anything of the change: dockhand's Generated-By, or an Assisted-by, Co-authored-by, or Signed-off-by trailer, in any case. A reference trailer, as Closes: with a ticket's URL, isn't one.

func ModifiedBuild

func ModifiedBuild(message string) bool

ModifiedBuild reports whether a message's Generated-By names a dockhand built from uncommitted source, which nobody else can find.

func OtherBuilds

func OtherBuilds(messages []string) []string

OtherBuilds are the builds messages' attribution lines name other than this one, each once, in order: a pre-v3 branch's commit names "v0.0.0-20260921…", which a rebase keeps and a commit tidy writes again replaces (the flatbuffers, nuspell, zola, and alertmanager run's finding 4).

func RebuildFor added in v0.7.0

func RebuildFor(subject string) (string, bool)

RebuildFor is the port a rebuild's subject rebuilds for, as update --revbump-dependents writes them: libunibreak for "taisei: rebuild for libunibreak 8.0". False for any other subject.

func SplitTrailers added in v0.5.0

func SplitTrailers(text string) (string, []string)

SplitTrailers separates a body's final paragraph when every line of it is a trailer.

func Subject

func Subject(name, subject string) (string, error)

Subject composes the commit subject MacPorts asks for, "<port>: <what changed>". The person writes only what follows the port name, so a subject that already carries it is refused rather than doubled.

func SubjectPorts added in v0.4.0

func SubjectPorts(subject string) []string

SubjectPorts are the ports a subject in MacPorts' form names, "a, b: what changed": the names before its first colon; none where it has no colon. A pull request's title takes the same form.

func TicketURL added in v0.7.0

func TicketURL(number string) string

TicketURL is a Trac ticket's URL, as a Closes: trailer cites it.

func TitlePorts added in v0.7.0

func TitlePorts(title string) []string

TitlePorts are the ports a pull request's title names as a subject does (SubjectPorts), after any bracketed tags before it, as "[WIP] jq: update to 1.8.1" or the acceptance stage's "testing …".

func Unchanged

func Unchanged(had, want string) bool

Unchanged reports whether a commit with message had can stand for one with message want: they say the same, but perhaps for dockhand's attribution line, which names the build that wrote each and so differs across builds, where both carry one. The one already written names the build that wrote it, which stays true; unless that build was of uncommitted source, which nobody can find, and which tidying again is meant to replace.

func UpdateTo added in v0.8.0

func UpdateTo(subject string) (port, version string, ok bool)

UpdateTo is the port and version of an update's subject as update writes it, "tao: update to 8.0.8": one port, one version, nothing after. False for any other subject, as "tao: update to 8.0.8, fix build" or "ace, tao: update to 8.0.8".

Types

This section is empty.

Jump to

Keyboard shortcuts

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