gitMessage

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package gitMessage

Index

Constants

View Source
const (
	EnvKeyGitMobMessagePath = "GITMOB_MESSAGE_PATH"
)

Variables

This section is empty.

Functions

func AppendCoauthorMarkup

func AppendCoauthorMarkup(newCoauthors []authors.Author, msgBytes []byte) ([]byte, []byte, error)

AppendCoauthorMarkup appends Co-Authored-By markup to a commit message

func CommitTemplatePath

func CommitTemplatePath() string

CommitTemplatePath is ported from git-mob/src/git-message/index/commitTemplatePath

func FormatCoAuthorList

func FormatCoAuthorList(coAuthorList []authors.Author) string

FormatCoAuthorList takes a list of authors in the form "name <email>" and formats them as a newline-separated list of Co-authored-by tags

func Path

func Path() string

Path is ported from git-mob/src/git-message/index/gitMessagePath

func Write

func Write(p string, coAuthorList ...authors.Author) error

func WriteGitMessage

func WriteGitMessage(coAuthorList ...authors.Author) error

Types

type Source

type Source int
const (
	// comments from: https://git-scm.com/docs/githooks#_prepare_commit_msg
	UnknownSource  Source = iota
	EmptySource           // commit: source not provided
	MessageSource         // commit-with-message: if a -m or -F option was given
	TemplateSource        // commit-with-template: if a -t option was given or the configuration option commit.template is set
	MergeSource           // merge-commit: if the commit is a merge or a .git/MERGE_MSG file exists
	SquashSource          // squash-commit: if a .git/SQUASH_MSG file exists
	CommitSource          // amending: followed by a commit object name (if a -c, -C or --amend option was given)
)

func CommitMsgSourceFromString

func CommitMsgSourceFromString(s string) Source

func (Source) String

func (s Source) String() string

Jump to

Keyboard shortcuts

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