exec

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const BranchPrefix = "AI"

BranchPrefix is the prefix for the branch name

Variables

This section is empty.

Functions

func AiderCommand

func AiderCommand(contextFile string, step settings.Step, config settings.Aider) string

func GetAllPossiblePaths

func GetAllPossiblePaths(projectConfig settings.Project, projectRepo redminemodels.Repository, forGit bool) ([]string, error)

func IsAiderInstalled added in v0.9.1

func IsAiderInstalled() bool

func IsGitInstalled added in v0.9.1

func IsGitInstalled() bool

func IsTreeInstalled added in v1.0.1

func IsTreeInstalled() bool

Types

type Git

type Git struct {
	Opened bool
	// contains filtered or unexported fields
}

func FindProjectGit

func FindProjectGit(projectConfig settings.Project, projectRepo redminemodels.Repository) (*Git, error)

func NewGit

func NewGit(path string) *Git

func (*Git) Add added in v0.9.1

func (g *Git) Add(path string) error

func (*Git) BranchExists added in v0.9.1

func (g *Git) BranchExists(branchName string) (bool, error)

func (*Git) BranchName

func (g *Git) BranchName(issueID int) string

func (*Git) CheckoutBranch

func (g *Git) CheckoutBranch(branchName string) error

CheckoutBranch checks out a branch or creates if missing. go-git can fail if there are files that are not in gitignore.

func (*Git) Commit added in v0.9.1

func (g *Git) Commit(message string) (string, error)

func (*Git) DeleteBranch

func (g *Git) DeleteBranch(branchName string) error

func (*Git) ExecCheckoutBranch added in v0.9.1

func (g *Git) ExecCheckoutBranch(branchName string) error

func (*Git) GetAffectedFiles

func (g *Git) GetAffectedFiles(sha string) ([]string, error)

func (*Git) GetCurrentBranchName

func (g *Git) GetCurrentBranchName() (string, error)

GetCurrentBranchName returns the current branch name

func (*Git) GetLastCommitHash

func (g *Git) GetLastCommitHash() (string, error)

func (*Git) GetLastCommits

func (g *Git) GetLastCommits(count int) ([]string, error)

GetLastCommits returns the last n commit hashes. First commit is the most recent one.

func (*Git) GetPath

func (g *Git) GetPath() string

func (*Git) Open

func (g *Git) Open() error

func (*Git) Reload

func (g *Git) Reload()

func (*Git) SetPath

func (g *Git) SetPath(path string)

type GitInterface

type GitInterface interface {
	GetAffectedFiles(sha string) ([]string, error)
	GetLastCommits(count int) ([]string, error)
	GetLastCommitHash() (string, error)
	BranchName(issueID int) string
	CheckoutBranch(name string) error
	ExecCheckoutBranch(name string) error
	GetPath() string
	SetPath(path string)
	Reload()
	DeleteBranch(string) error
}

type Output

type Output struct {
	Command string
	Stdout  string
	Stderr  string
}

func Exec

func Exec(command string, timeout time.Duration, args ...string) (Output, error)

Exec executes command with timeout.

func WithContext

func WithContext(ctx context.Context, command string, args ...string) (Output, error)

WithContext executes command with context for cancellation and timeout.

func (Output) AsPrompt

func (o Output) AsPrompt() string

type Workbench

type Workbench struct {
	Git        GitInterface
	Issue      redmine.Issue
	WorkingDir string
}

func (*Workbench) CheckoutBranch added in v0.9.1

func (i *Workbench) CheckoutBranch(branchName string) error

func (*Workbench) DeleteBranch

func (i *Workbench) DeleteBranch(branch string) error

func (*Workbench) GetAffectedFiles

func (i *Workbench) GetAffectedFiles(sha string) ([]string, error)

func (*Workbench) GetBranchCommits

func (i *Workbench) GetBranchCommits(count int) ([]string, error)

GetBranchCommits last is newest. First commit is the newest one.

func (*Workbench) GetCommitsSinceInReverseOrder

func (i *Workbench) GetCommitsSinceInReverseOrder(sinceSha string) ([]string, error)

func (*Workbench) GetIssueBranchName

func (i *Workbench) GetIssueBranchName(issue redmine.Issue) string

func (*Workbench) GetIssueBranchNameOverride

func (i *Workbench) GetIssueBranchNameOverride(issue redmine.Issue) string

GetIssueBranchNameOverride in UI user can set branch name override. Use it if set.

func (*Workbench) GetIssueSkipMergeOverride added in v0.9.1

func (i *Workbench) GetIssueSkipMergeOverride(issue redmine.Issue) bool

GetIssueSkipMergeOverride in UI user can set flag to not merge into parent. Use it if set.

func (*Workbench) GetLastCommit

func (i *Workbench) GetLastCommit() (string, error)

GetLastCommit returns the last commit hash

func (*Workbench) GoToRepo

func (i *Workbench) GoToRepo() error

func (*Workbench) PrepareWorkplace

func (i *Workbench) PrepareWorkplace(targetBranches ...string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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