Documentation ¶
Index ¶
- Constants
- Variables
- func CleanCommand(repo *core.Repo, gh func(context.Context) core.Gh) *cli.Command
- func CloseCommand(repo *core.Repo, gh func(context.Context) core.Gh) *cli.Command
- func CommentCommand(repo *core.Repo, gh func(context.Context) core.Gh) *cli.Command
- func FirstAncestorCommit(repo *core.Repo, pr *core.LocalPr) (*object.Commit, error)
- func HeadCommit(repo *core.Repo, args cli.Args) (plumbing.Hash, error)
- func InitCommand(repo *core.Repo) *cli.Command
- func MakeApp(out io.Writer, repo *core.Repo, gh func(context.Context) core.Gh) *cli.App
- func MergeCommand(repo *core.Repo, gh func(context.Context) core.Gh) *cli.Command
- func PrCommand(repo *core.Repo, gh func(context.Context) core.Gh) *cli.Command
- func PrFromFirstArgument(repo *core.Repo, cCtx *cli.Context) (*core.LocalPr, bool, error)
- func PrFromStringOrCurrentBranch(repo *core.Repo, str string) (*core.LocalPr, bool, error)
- func PrintFailure(err any)
- func PrintSuccess()
- func PushCommand(repo *core.Repo) *cli.Command
- func RebaseCommand(repo *core.Repo) *cli.Command
- func SetShortMergeabilityIntervalForTests() func()
- func StatusCommand(out io.Writer, repo *core.Repo, gh func(context.Context) core.Gh) *cli.Command
Constants ¶
View Source
const ErrorPattern = "could not %s a global gitignore file, please add .opp to your .gitignore file manually"
Variables ¶
View Source
var ( ErrLostPrCreationRaceCondition = errors.New("lost race condition when creating PR") ErrLostPrCreationRaceConditionMultipleTimes = errors.New("lost race condition when creating PR too many times, aborting") ErrAlreadyAPrBranch = errors.New(strings.TrimSpace(` You are on a branch that has already been pushed as a PR Use opp up to update that PR instead.`)) BaseFlagUsage = strings.TrimSpace(` Specify what is the base for your PR (either the base branch or another PR). If you leave this blank, opp is going to detect what is the right base for your PR by walking back the history until it finds either the main branch or the tip of another PR. `) CheckoutFlagUsage = strings.TrimSpace(` By default, opp pr tries to leave you on the branch you were. Use --checkout if you want to checkout the PR branch. There are some cases where opp pr still checkouts the PR branch after creation: when you specified a different base for example. `) DraftFlagUsage = "Create a draft PR." Description = strings.TrimSpace(` Starting from either HEAD, or the provided reference (HEAD~1, a74c9e, a_branch, ...) and walking back, gathers commits until it finds either the tip of a PR branch (e.g. pr/xxx) or the base branch and creates a PR that contains these commits. If you provide a different --base, these commits will be rebased on that new base, and if this is a clean rebase it will create a PR targetting that base. If you don't, it will create a PR targetting either the base branch or another PR, depending on whether it reached the base branch or the tip of another PR first when walking back. `) )
View Source
var (
ErrBeingEvaluated = errors.New("still being checked by github")
)
Functions ¶
func CleanCommand ¶
func CloseCommand ¶
func CommentCommand ¶
func FirstAncestorCommit ¶
Returns the first commit in the history of pr that belongs to its ancestor, and does not belong to the PR.
func InitCommand ¶
func MergeCommand ¶
func PrFromFirstArgument ¶
PrFromFirstArgument returns the PR number supplied as a commandline argument, or if no argument is supplied, the PR for the current branch. The PR number can be supplied as a simple integer, or in the form `pr/$number`.
func PrFromStringOrCurrentBranch ¶
PrFromStringOrCurrentBranch returns the PR based on the given string (if non-empty), or the current branch.
func PrintFailure ¶
func PrintFailure(err any)
func PrintSuccess ¶
func PrintSuccess()
func PushCommand ¶
func RebaseCommand ¶
func SetShortMergeabilityIntervalForTests ¶
func SetShortMergeabilityIntervalForTests() func()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.