Documentation ¶
Index ¶
- func SetDefaultExecutor(exec Executor)
- type Cmd
- type Commit
- type CommitMessage
- func (m *CommitMessage) Body() string
- func (m *CommitMessage) BodyLines() []string
- func (m *CommitMessage) CommentChar() string
- func (m *CommitMessage) IsEmpty() bool
- func (m *CommitMessage) IsFixup() bool
- func (m *CommitMessage) IsSquash() bool
- func (m *CommitMessage) Lines() []string
- func (m *CommitMessage) Message() string
- func (m *CommitMessage) Raw() string
- func (m *CommitMessage) Subject() string
- type Executor
- type FileList
- type Option
- type Range
- type Ref
- type XmlCommit
- type XmlLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultExecutor ¶
func SetDefaultExecutor(exec Executor)
Types ¶
type Cmd ¶
func (*Cmd) AddOptions ¶
type Commit ¶
type Commit struct { Hash string Names string Date string Author string Subject string Body string }
func CreateCommitFromXML ¶
type CommitMessage ¶
type CommitMessage struct {
// contains filtered or unexported fields
}
CommitMessage represents a git commit message You can access the message's Subject and Body
func NewCommitMessage ¶
func NewCommitMessage(msg string, commentChar string) *CommitMessage
NewCommitMessage is the CommitMessage struct constructor
func NewCommitMessageFromFile ¶
func NewCommitMessageFromFile(file, commentChar string) (*CommitMessage, error)
NewCommitMessageFromFile creates a CommitMessage struct by reading the contents a file
func (*CommitMessage) Body ¶
func (m *CommitMessage) Body() string
Body returns a string starting from line 3
func (*CommitMessage) BodyLines ¶
func (m *CommitMessage) BodyLines() []string
BodyLines returns all lines starting from line 3
func (*CommitMessage) CommentChar ¶
func (m *CommitMessage) CommentChar() string
CommentChar returns the configured comment character, default is `#`
func (*CommitMessage) IsEmpty ¶
func (m *CommitMessage) IsEmpty() bool
IsEmpty returns true if the commit message does not have any content
func (*CommitMessage) IsFixup ¶
func (m *CommitMessage) IsFixup() bool
IsFixup indicates if a commit is a `--fixup` commit
func (*CommitMessage) IsSquash ¶
func (m *CommitMessage) IsSquash() bool
IsSquash indicates if a commit is a `--squash` commit
func (*CommitMessage) Lines ¶
func (m *CommitMessage) Lines() []string
Lines returns all lines except comment lines
func (*CommitMessage) Message ¶
func (m *CommitMessage) Message() string
Message returns the commit message without comments
func (*CommitMessage) Raw ¶
func (m *CommitMessage) Raw() string
Raw returns the raw content of the commit message with comments and everything
func (*CommitMessage) Subject ¶
func (m *CommitMessage) Subject() string
Subject returns the first line of the commit message
type XmlCommit ¶
type XmlCommit struct { XMLName xml.Name `xml:"commit"` Hash string `xml:"hash"` Names string `xml:"names"` Date string `xml:"date"` Author string `xml:"author"` Subject string `xml:"subject"` Body string `xml:"body"` }
XmlCommit is used to represent commits in a commit log
type XmlLog ¶
XmlLog is used to read commit messages from the git log Via log --format the log command creates xml output that can be parsed into these structs. XmlLog being just the container for the list of XmlCommit structs
<commit> <hash>55d061</hash> <names><![CDATA[head]]></names> <date>2023-04-23</date> <author><![CDATA[Sebastian Feldmann <sf@sebastian-feldmann.info>]]></author> <subject><![CDATA[Fix example docs]]></subject> <body><![CDATA[]]></body> </commit>
func ParseLogXml ¶
ParseLogXml is used to read infos from the git log