commit

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlaceholderHash    string = "1234567890abcdef1234567890abcdef12345678"
	PlaceholderSummary string = "Capitalized, short (50 chars or less) summary"
)

Variables

View Source
var PlaceholderHelp string
View Source
var PlaceholderMessage string

Functions

func EmojiConfigToEmojiProfile added in v0.6.2

func EmojiConfigToEmojiProfile(e config.EmojiSet) emoji.Profile

func EmojiSummaryToSubject added in v0.4.0

func EmojiSummaryToSubject(emoji, summary string) string

func FileCreate added in v0.8.0

func FileCreate() func(string) (io.WriteCloser, error)

func FileExists added in v0.8.0

func FileExists(file string) bool

func FileOpen added in v0.5.0

func FileOpen() func(string) (io.Reader, error)

func MessageToBody added in v0.4.0

func MessageToBody(msg string) string

func MessageToEmoji added in v0.4.0

func MessageToEmoji(set *emoji.Set, msg string) emoji.NullEmoji

func MessageToSummary added in v0.4.0

func MessageToSummary(msg string) string

func SortUsersByDefault added in v0.7.0

func SortUsersByDefault(us ...repository.User) []repository.User

func UserToAuthor added in v0.4.0

func UserToAuthor(user repository.User) string

Types

type Applier added in v0.5.0

type Applier func(repository.Commit, ...func(c *repository.Commit)) error

type Commit

type Commit struct {
	Options     Options
	Emojier     Emojier
	Configer    Configer
	Snapshotter Snapshotter
	Opener      Opener
	Repoer      Repoer
	Creator     Creator
	Saver       Saver
}

func New

func New() Commit

func (*Commit) Apply added in v0.3.0

func (c *Commit) Apply(req *Request) error

func (*Commit) Configure added in v0.5.0

func (c *Commit) Configure(opts Options) (*State, error)

type Config

type Config struct {
	View    config.View
	Commit  config.Commit
	Authors []repository.User
}

type Configer added in v0.8.0

type Configer interface {
	Load(io.Reader) (config.Config, error)
	Save(io.WriteCloser, config.Config) error
}

type Creator added in v0.8.0

type Creator func(string) (io.WriteCloser, error)

type Emojier added in v0.5.0

type Emojier func(...func(*emoji.Set)) *emoji.Set

type Opener added in v0.5.0

type Opener func(string) (io.Reader, error)

type Options added in v0.1.1

type Options struct {
	ConfigFile   string
	SnapshotFile string
	DryRun       bool
	Amend        bool
}

type Placeholders added in v0.2.0

type Placeholders struct {
	Hash    string
	Summary string
	Body    string
	Help    string
}

type Repoer added in v0.5.0

type Repoer interface {
	Open() error
	Describe() (repository.Description, error)
	Apply(repository.Commit) error
	IgnoreGlobalConfig()
}

type Request added in v0.4.0

type Request struct {
	Apply   bool
	Emoji   string
	Summary string
	Body    string
	RawBody string
	Footer  string
	Author  repository.User
	Amend   bool
	DryRun  bool
}

type Saver added in v0.8.0

type Saver func(io.WriteCloser, snapshot.Snapshot) error

type Snapshotter added in v0.8.0

type Snapshotter interface {
	Load(io.Reader) (snapshot.Snapshot, error)
	Save(io.WriteCloser, snapshot.Snapshot) error
}

type State added in v0.5.0

type State struct {
	Placeholders Placeholders
	Repository   repository.Description
	Emojis       *emoji.Set
	Theme        theme.Theme
	Config       config.Config
	Snapshot     snapshot.Snapshot
	Options      Options
}

Jump to

Keyboard shortcuts

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