Documentation
¶
Index ¶
- Variables
- func MergeReqCheckoutCmd(r types.LocalRepo, args *MergeReqCheckoutArgs) error
- func MergeReqCloseCmd(r types.LocalRepo, args *MergeReqCloseArgs) error
- func MergeReqFetchCmd(r types.LocalRepo, args *MergeReqFetchArgs) error
- func MergeReqReopenCmd(r types.LocalRepo, args *MergeReqReopenArgs) error
- func MergeReqStatusCmd(r types.LocalRepo, args *MergeReqStatusArgs) error
- func MergeRequestCreateCmd(r types.LocalRepo, args *MergeRequestCreateArgs) error
- func MergeRequestListCmd(targetRepo types.LocalRepo, args *MergeRequestListArgs) error
- func MergeRequestReadCmd(targetRepo types.LocalRepo, args *MergeRequestReadArgs) error
- func NormalMergeReferenceName(curRepo types.LocalRepo, args []string) string
- type MergeReqCheckoutArgs
- type MergeReqCloseArgs
- type MergeReqFetchArgs
- type MergeReqReopenArgs
- type MergeReqStatusArgs
- type MergeRequestCreateArgs
- type MergeRequestListArgs
- type MergeRequestReadArgs
Constants ¶
This section is empty.
Variables ¶
var MergeReqCmd = &cobra.Command{ Use: "mr", Short: "Create, read, list and respond to merge requests", Long: ``, Run: func(cmd *cobra.Command, args []string) { _ = cmd.Help() }, }
MergeReqCmd represents the merge request command
Functions ¶
func MergeReqCheckoutCmd ¶
func MergeReqCheckoutCmd(r types.LocalRepo, args *MergeReqCheckoutArgs) error
MergeReqCheckoutCmd checkouts a merge request target or base branch
func MergeReqCloseCmd ¶
func MergeReqCloseCmd(r types.LocalRepo, args *MergeReqCloseArgs) error
MergeReqCloseCmd adds a close directive
func MergeReqFetchCmd ¶
func MergeReqFetchCmd(r types.LocalRepo, args *MergeReqFetchArgs) error
MergeReqFetchCmd fetches a merge request target or base branch
func MergeReqReopenCmd ¶
func MergeReqReopenCmd(r types.LocalRepo, args *MergeReqReopenArgs) error
MergeReqReopenCmd adds a negative close directive to a merge request
func MergeReqStatusCmd ¶
func MergeReqStatusCmd(r types.LocalRepo, args *MergeReqStatusArgs) error
MergeReqStatusCmd prints the status of the merge request
func MergeRequestCreateCmd ¶
func MergeRequestCreateCmd(r types.LocalRepo, args *MergeRequestCreateArgs) error
MergeRequestCreateCmd create a new merge request or adds a comment to an existing one
func MergeRequestListCmd ¶
func MergeRequestListCmd(targetRepo types.LocalRepo, args *MergeRequestListArgs) error
MergeRequestListCmd list all merge requests
func MergeRequestReadCmd ¶
func MergeRequestReadCmd(targetRepo types.LocalRepo, args *MergeRequestReadArgs) error
MergeRequestReadCmd read comments in a merge request post
Types ¶
type MergeReqCheckoutArgs ¶
type MergeReqCheckoutArgs struct {
// Reference is the full reference path to the merge request
Reference string
// ReadPostBody is a function for reading post body in a commit
ReadPostBody plumbing.PostBodyReader
// ForceCheckout ignores unsaved local changes and forces checkout
ForceCheckout bool
// ForceFetch forcefully fetches the target
ForceFetch bool
// Remote dictates which git remote to fetch target from
Remote string
// Base indicates that the base branch should be checked out instead of target
Base bool
// Yes indicates that all confirm prompts are answered as 'Yes' automatically
YesCheckoutDiffTarget bool
// ConfirmInput is a function for requesting user confirmation
ConfirmInput io2.ConfirmInputReader
StdOut io.Writer
}
MergeReqCheckoutArgs contains parameters for MergeReqCheckoutCmd
type MergeReqCloseArgs ¶
type MergeReqCloseArgs struct {
// Reference is the full reference path to the merge request
Reference string
// PostCommentCreator is the post commit creating function
PostCommentCreator plumbing.PostCommitCreator
// ReadPostBody is a function for reading post body in a commit
ReadPostBody plumbing.PostBodyReader
// Force indicates that uncommitted changes should be ignored
Force bool
}
MergeReqCloseArgs contains parameters for MergeReqCloseCmd
type MergeReqFetchArgs ¶
type MergeReqFetchArgs struct {
// Reference is the full reference path to the merge request
Reference string
// ForceFetch forcefully fetches the target
ForceFetch bool
// Remote dictates which git remote to fetch target from
Remote string
// Base indicates that the base branch should be checked out instead of target
Base bool
// ReadPostBody is a function for reading post body in a commit
ReadPostBody plumbing.PostBodyReader
}
MergeReqFetchArgs contains parameters for MergeReqFetchCmd
type MergeReqReopenArgs ¶
type MergeReqReopenArgs struct {
// Reference is the full reference path to the merge request
Reference string
// PostCommentCreator is the post commit creating function
PostCommentCreator plumbing.PostCommitCreator
// ReadPostBody is a function for reading post body in a commit
ReadPostBody plumbing.PostBodyReader
// Force indicates that uncommitted changes should be ignored
Force bool
}
MergeReqReopenArgs contains parameters for MergeReqReopenCmd
type MergeReqStatusArgs ¶
type MergeReqStatusArgs struct {
// Reference is the full reference path to the merge request
Reference string
// ReadPostBody is a function for reading post body in a commit
ReadPostBody plumbing.PostBodyReader
StdOut io.Writer
}
MergeReqStatusArgs contains parameters for MergeReqStatusCmd
type MergeRequestCreateArgs ¶
type MergeRequestCreateArgs struct {
// ID is the unique post ID
ID int
// Title is the title of the merge request
Title string
// Body is the merge request body
Body string
// ReplyHash is the hash of a comment commit
ReplyHash string
// Reactions adds or removes reactions to/from a comment commit
// Negated reactions indicate removal request
Reactions []string
// Base is the base branch name
Base string
// BaseHash is hash of the base branch
BaseHash string
// Target is the target branch name
Target string
// TargetHash is the target hash name
TargetHash string
// UseEditor indicates that the body of the Issue should be collected using a text editor.
UseEditor bool
// EditorPath indicates the path to an editor program
EditorPath string
// NoBody prevents prompting user for comment body
NoBody bool
// Close sets close status to 1.
Close *bool
// Open sets close status to 0
Open bool
// Force indicates that uncommitted changes should be ignored
Force bool
// StdOut receives the output
StdOut io.Writer
// StdIn receives input
StdIn io.ReadCloser
// PostCommentCreator is the post commit creating function
PostCommentCreator plumbing.PostCommitCreator
// EditorReader is used to read from an editor program
EditorReader util.EditorReaderFunc
// InputReader is a function that reads input from stdin
InputReader io2.InputReader
}
type MergeRequestListArgs ¶
type MergeRequestListArgs struct {
// Limit sets a hard limit on the number of merge requests to display
Limit int
// Reverse indicates that the merge requests should be listed in reverse order
Reverse bool
// DateFmt is the date format to use for displaying dates
DateFmt string
// PostGetter is the function used to get merge-request posts
PostGetter plumbing2.PostGetter
// PagerWrite is the function used to write to a pager
PagerWrite common.PagerWriter
// Format specifies a format to use for generating each post output to Stdout.
// The following place holders are supported:
// - %i - Index of the post
// - %bb - Base branch name
// - %bh - Base branch hash
// - %tb - Target branch name
// - %th - Target branch hash
// - %a - Author of the post
// - %e - Author email
// - %t - Title of the post
// - %c - The body/preview of the post
// - %d - Date of creation
// - %H - The full hash of the first comment
// - %h - The short hash of the first comment
// - %n - The reference name of the post
// - %pk - The push key address
Format string
// NoPager indicates that output must not be piped into a pager
NoPager bool
StdOut io.Writer
StdErr io.Writer
}
type MergeRequestReadArgs ¶
type MergeRequestReadArgs struct {
// MergeRequestPath is the full path to the merge request post
Reference string
// Limit sets a hard limit on the number of merge requests to display
Limit int
// Reverse indicates that the merge requests should be listed in reverse order
Reverse bool
// DateFmt is the date format to use for displaying dates
DateFmt string
// PostGetter is the function used to get merge request posts
PostGetter plumbing2.PostGetter
// PagerWrite is the function used to write to a pager
PagerWrite common.PagerWriter
// Format specifies a format to use for generating each comment output to Stdout.
// The following place holders are supported:
// - %i - Index of the comment
// - %i - Index of the post
// - %bb - Base branch name
// - %bh - Base branch hash
// - %tb - Target branch name
// - %th - Target branch hash
// - %a - Author of the comment
// - %e - Author email
// - %t - Title of the comment
// - %c - The body of the comment
// - %d - Date of creation
// - %H - The full hash of the comment
// - %h - The short hash of the comment
// - %n - The reference name of the merge request post
// - %l - The label attached to the comment
// - %as - The assignees attached to the comment
// - %r - The short commit hash the current comment is replying to.
// - %R - The full commit hash the current comment is replying to.
// - %rs - The comment's reactions.
// - %pk - The push key address
// - %cl - Flag for close status of the post (true/false)
Format string
// NoPager indicates that output must not be piped into a pager
NoPager bool
// NoCloseStatus indicates that the close status must not be rendered
NoCloseStatus bool
StdOut io.Writer
StdErr io.Writer
}
MergeRequestReadArgs contains arguments used by MergeRequestReadCmd function