Documentation
¶
Index ¶
- Constants
- Variables
- func Execute()
- func GetFileSelection(args []string, commitAll bool, commitUntracked bool) ([]string, error)
- func ListAllFilesByPattern(patterns ...string) ([]string, error)
- func ListStagedFiles() ([]string, error)
- func ListUntrackedFiles() ([]string, error)
- func ValidateGitRepo() (string, error)
- type CommitSettings
- type Flag
- type PrSettings
- type RunSettings
Constants ¶
View Source
const VERSION = "0.0.3"
VERSION number: changed in CI
Variables ¶
View Source
var ( BranchFlag = Flag{ Short: "B", Long: "branch", Description: "The name of the target branch of the commit. When used in conjunction with the --use-pr " + "flag, the branch is the base ref of the PR created. Otherwise, the commit is pushed directly to the " + "branch.", Required: true, Type: "string", } MessageFlag = Flag{ Short: "m", Long: "message", Description: "The message connected to the commit. When used in conjunction with --use-pr, the " + "commit message is used as the PR title and PR description, unless overridden.", Required: true, Type: "string", } UsePrFlag = Flag{ Short: "P", Long: "use-pr", Description: "Create a PR rather than committing directly to the branch. Unless a head-ref is " + "specified manually, the head ref name is generated in the format of <BASE REF>-<RANDOM SALT>.", Required: false, Type: "bool", } HeadRefFlag = Flag{Short: "H", Long: "head-ref", Description: "The name of the branch created with the base ref being `--branch`. Only relevant if used in conjunction with the --use-pr flag.", Type: "string"} PrTitleFlag = Flag{Short: "T", Long: "title", Description: "The title of the PR created. Only relevant if used in conjunction with the --use-pr flag. If not specified, the PR title will be the commit message.", Type: "string"} PrDescFlag = Flag{Short: "D", Long: "pr-description", Description: "The description of the PR created. Only relevant if used in conjunction with the --use-pr flag. If not specified, the PR title will be the commit message.", Type: "string"} PrLabelFlag = Flag{Short: "l", Long: "label", Description: "A list of labels to add to the PR created. Only relevant if used in conjunction with the --use-pr flag. Labels can be added recursively -- i.e. -l feature -l blocked.", Type: "stringSlice"} SyncLocal = Flag{Short: "s", Long: "sync-local", Description: "Sync the local branch with the remote branch. Only relevant if the target branch is the same as the local branch. Incompatible with --use-pr flag.", Type: "bool"} AllFlag = Flag{Short: "A", Long: "all", Description: "Commit all tracked files that have changed. Only relevant if the target branch is the same as the local branch.", Type: "bool"} Untracked = Flag{Short: "U", Long: "untracked", Description: "Include untracked files in the commit. Only relevant if used in conjunction with the --all flag.", Type: "bool"} DryRun = Flag{Short: "d", Long: "dry-run", Description: "Show which files would be committed.", Type: "bool"} )
View Source
var RootPath string
Functions ¶
func GetFileSelection ¶ added in v0.0.7
func ListAllFilesByPattern ¶ added in v0.0.7
func ListStagedFiles ¶ added in v0.0.7
func ListUntrackedFiles ¶ added in v0.0.7
func ValidateGitRepo ¶ added in v0.0.7
Types ¶
type CommitSettings ¶ added in v0.0.7
type PrSettings ¶ added in v0.0.7
type RunSettings ¶ added in v0.0.7
type RunSettings struct {
PrSettings *PrSettings
CommitSettings *CommitSettings
FileSelection []string
SyncLocal bool
DryRun bool
}
func (*RunSettings) Commit ¶ added in v0.0.7
func (rn *RunSettings) Commit() error
func (*RunSettings) ExecuteDryRun ¶ added in v0.0.7
func (rn *RunSettings) ExecuteDryRun()
Click to show internal directories.
Click to hide internal directories.