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 ¶
- func Attributed(message string) bool
- func Body(message string) string
- func Build(message string) (string, bool)
- func Compose(subject, text string, combined, tickets []string, generated bool) string
- func GeneratedBy() string
- func IsAttribution(line string) bool
- func IsAttributionTrailer(line string) bool
- func ModifiedBuild(message string) bool
- func OtherBuilds(messages []string) []string
- func RebuildFor(subject string) (string, bool)
- func SplitTrailers(text string) (string, []string)
- func Subject(name, subject string) (string, error)
- func SubjectPorts(subject string) []string
- func TicketURL(number string) string
- func TitlePorts(title string) []string
- func Unchanged(had, want string) bool
- func UpdateTo(subject string) (port, version string, ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attributed ¶
Attributed reports whether a commit message carries dockhand's attribution line, as tidy writes it on a commit of dockhand's own edits.
func Build ¶
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
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 ¶
IsAttribution reports whether a message line is dockhand's trailer.
func IsAttributionTrailer ¶ added in v0.5.0
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 ¶
ModifiedBuild reports whether a message's Generated-By names a dockhand built from uncommitted source, which nobody else can find.
func OtherBuilds ¶
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
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
SplitTrailers separates a body's final paragraph when every line of it is a trailer.
func Subject ¶
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
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 TitlePorts ¶ added in v0.7.0
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 ¶
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.
Types ¶
This section is empty.