Versions in this module Expand all Collapse all v0 v0.1.62 Oct 23, 2026 Changes in this version + var ErrInvalidSource = errors.New("invalid source request") + var ErrNoCommitView = errors.New("no web commit view") + var ErrPipelinesUnsupported = errors.New("pipelines are not supported by this git provider") + var ErrRevisionNotFound = errors.New("revision does not resolve to one commit") + var ErrSourceChanged = errors.New("source changed while capturing") + var ErrUnmergedIndex = errors.New("unmerged index") + var ErrUnrelatedHistories = errors.New("the commits share no history") + var ErrUnsupportedSource = errors.New("unsupported source") + func ActivityMentions(body string) []string + type BlameAuthor struct + Email string + Name string + type BlameCommit struct + Author BlameAuthor + Date time.Time + SHA string + Subject string + URL string + type BlameLine struct + Commit *BlameCommit + Content string + Line int + OriginalLine int + Path string + type BlameOptions struct + Contents []byte + Path string + SHA string + type BlobRequest struct + Path string + SHA string + type BlobResult struct + Content []byte + Object string + Present bool type Cache + func (c *Cache) Blame(ctx context.Context, repo *Repository, options BlameOptions) (lines []BlameLine, err error) + func (c *Cache) Changes(ctx context.Context, repo *Repository, options ChangesOptions) ([]Change, error) + func (c *Cache) Files(ctx context.Context, repo *Repository, sha string) ([]string, error) + func (c *Cache) MergeBase(ctx context.Context, repo *Repository, options MergeBaseOptions) (string, error) + func (c *Cache) OpenTree(ctx context.Context, options TreeOptions) (result *Tree, err error) + func (c *Cache) PrepareSource(ctx context.Context, options SourceOptions) (source *PreparedSource, err error) + func (c *Cache) ReadBlobs(ctx context.Context, repo *Repository, requests []BlobRequest) ([]BlobResult, error) + type Change struct + NewMode string + NewObject string + OldMode string + OldObject string + Path string + Status FileStatus type ChangeRequest + Head string + Pick PickStrategy + Rebase string + Source *Repository + Squash bool + type ChangesOptions struct + Base string + Head string + type ClientOptions struct + SecurityNamespace string + TransportPool *commonshttp.TransportPool + type Fingerprint struct + Root string + SHA string + func WorktreeFingerprint(ctx context.Context, directory string) (Fingerprint, error) + type HistoryDetail string + const HistoryMetadata + const HistoryNames + const HistoryStatus type HistoryOptions + Detail HistoryDetail + Offset int type LogOptions + Base string + Head string + HeadFrom *Repository + type MergeBaseOptions struct + Base string + Head string + HeadFrom *Repository + type Page struct + Items []T + NextCursor string + type PickStrategy string + const PickCherryPick + const PickReplay + type Pipeline struct + ID string + Name string + Path string + State string + URL string + type PipelineExecution struct + Attempt int + Author string + Branch string + CreatedAt time.Time + ID string + Name string + Number string + Pipeline string + Result string + SHA string + Status string + URL string + type PipelineOptions struct + Branch string + Cursor string + Limit int + Pipeline string + Repository RepoURL + type PipelineProvider interface + ListPipelineExecutions func(context.Context, PipelineOptions) (Page[PipelineExecution], error) + ListPipelines func(context.Context, PipelineOptions) (Page[Pipeline], error) + func PipelineAPI(provider Provider) (PipelineProvider, error) + type PreparedSource struct + func (s *PreparedSource) Changes() []SourceChange + func (s *PreparedSource) Info() SourceInfo + func (s *PreparedSource) Release() error type PullRequest + Metadata *PullRequestMetadata type PullRequestActivity + Action string + ID string + Mentions []string + UpdatedAt time.Time + type PullRequestCheck struct + Name string + Required bool + State string + URL string + type PullRequestChecksReader interface + PullRequestChecks func(context.Context, RepoURL, PullRequest) ([]PullRequestCheck, error) + type PullRequestMetadata struct + Author string + AuthorAvatarURL string + BaseBranch string + BaseBranchURL string + BaseCommitURL string + BaseSHA string + Checks []PullRequestCheck + CreatedAt time.Time + Draft bool + HeadBranch string + HeadBranchURL string + HeadCommitURL string + HeadSHA string + MergeReason string + Mergeability string + func ReadPullRequestMetadata(ctx context.Context, provider Provider, repo RepoURL, ...) (*PullRequestMetadata, error) + type PullRequestMetadataOptions struct + BaseSHA string + Number int type RepoURL + func (u RepoURL) CommitURL(sha string) (string, error) + func (u RepoURL) RefWebURL(options WebRefOptions) (string, error) + func (u RepoURL) SourceRepository(name string) (RepoURL, error) + type SourceChange struct + Path string + Status FileStatus + type SourceInfo struct + BaseCommit string + Dir string + Kind SourceKind + RepositoryRoot string + TargetCommit string + TreeID string + type SourceKind string + const SourceCommit + const SourceStaged + const SourceWorktree + type SourceOptions struct + Directory string + Kind SourceKind + Revision string + type Tree struct + func (t *Tree) Close() error + func (t *Tree) Info() TreeInfo + func (t *Tree) Metadata(options InspectOptions) (Metadata, error) + func (t *Tree) Open(name string) (fs.File, error) + func (t *Tree) ReadDir(name string) ([]fs.DirEntry, error) + func (t *Tree) ReadFile(name string) ([]byte, error) + type TreeInfo struct + GitDirectory string + SHA string + type TreeOptions struct + Directory string + Repository *Repository + Revision string + type WebRefOptions struct + Kind RefKind + Ref string + Repository string v0.1.61 Oct 20, 2026 v0.1.60 Oct 19, 2026 Changes in this version + var ErrNoFileView = errors.New("no web file view") + var ErrPathNotFound = errors.New("path not found at commit") type Cache + func (c *Cache) History(ctx context.Context, repo *Repository, ref string, options HistoryOptions) ([]Commit, error) + func (c *Cache) Show(ctx context.Context, repo *Repository, sha, path string) ([]byte, error) type Commit + Renames []Rename + Status map[string]FileStatus + type CommitState string + const CommitStateError + const CommitStateFailure + const CommitStatePending + const CommitStateSuccess + type CommitStatus struct + Context string + Description string + State CommitState + TargetURL string + type FileStatus string + const FileAdded + const FileCopied + const FileDeleted + const FileModified + const FileRenamed + const FileTypeChanged + type HistoryOptions struct + Follow bool + Limit int + Paths []string + Since string + type ListPullRequestsOptions struct + Base string + Head string + Limit int + State PullRequestState type Provider + CommentPullRequest func(ctx context.Context, repo RepoURL, number int, body string) (string, error) + ListPullRequestActivity func(ctx context.Context, repo RepoURL, number int) ([]PullRequestActivity, error) + ListPullRequests func(ctx context.Context, repo RepoURL, options ListPullRequestsOptions) ([]PullRequest, error) + SetCommitStatus func(ctx context.Context, repo RepoURL, sha string, status CommitStatus) error type PullRequest + Author string + Body string + CreatedAt time.Time + HeadRepository string + HeadSHA string + type PullRequestActivity struct + Author string + Body string + CreatedAt time.Time + Kind PullRequestActivityKind + URL string + type PullRequestActivityKind string + const PullRequestComment + const PullRequestHistory + type PullRequestPolicy struct + BuildID int + ID int + MinimumApproverCount int + Name string + Required bool + Status string + URL string + type PullRequestReview struct + Policies []PullRequestPolicy + Reviewers []PullRequestReviewer + type PullRequestReviewReader interface + PullRequestReview func(ctx context.Context, repo RepoURL, number int) (PullRequestReview, error) + type PullRequestReviewer struct + ID string + Name string + Required bool + Vote int + type Rename struct + From string + To string type RepoURL + func (u RepoURL) FileURL(ref Ref, path string) (string, error) + type VisiblePaths struct + func ListVisiblePaths(ctx context.Context, directory string) (VisiblePaths, error) + func (visible VisiblePaths) Contains(path string) bool + func (visible VisiblePaths) IsIgnored(ctx context.Context, path string) (bool, error) v0.1.59 Oct 18, 2026 Changes in this version + var ErrBaseMoved = errors.New("change base moved off the expected commit") + var ErrBranchExists = errors.New("branch already exists on the remote") + var ErrNoIdentity = errors.New("no git user.name/user.email configured") + var ErrNotRepository = errors.New("not a git repository") + var ErrPullRequestsUnsupported = errors.New("pull requests are not supported by this git provider") + var ErrTagExists = errors.New("tag already exists on the remote") + func Redact(text string) string + func ValidateBranchName(name string) error + func ValidateRevision(rev string) error + func ValidateTagName(name string) error + type APIError struct + Body string + Method string + Provider string + StatusCode int + URL string + func (e *APIError) Error() string + type Auth struct + Password string + PrivateKey string + TLS TLS + Token string + Username string + func (a Auth) Validate() error + type Cache struct + Root string + func (c *Cache) Apply(ctx context.Context, repo *Repository, request ChangeRequest) (ChangeResult, error) + func (c *Cache) Checkout(ctx context.Context, repo *Repository, options CheckoutOptions) (*Worktree, error) + func (c *Cache) Compare(ctx context.Context, repo *Repository, base, head string) (Comparison, error) + func (c *Cache) Log(ctx context.Context, repo *Repository, base, head string, options LogOptions) ([]Commit, error) + type ChangeRequest struct + AllowEmpty bool + Author Signature + Base string + BaseSHA string + Branch string + CherryPick []string + CherryPickMainline int + Files []FileChange + Message string + PullRequest *PullRequestRequest + Tag *TagOptions + Trailers []string + type ChangeResult struct + Branch string + CommitSHA string + PullRequest *PullRequest + SkippedCherryPicks []string + Tag string + type CheckoutOptions struct + Depth int + Ephemeral bool + Ref string + type CherryPickConflictError struct + Commit string + Files []string + func (e *CherryPickConflictError) Error() string + type CherryPickEmptyError struct + Base string + Commit string + func (e *CherryPickEmptyError) Error() string + type Client struct + Auth Auth + Provider Provider + Type string + func FromConnection(ctx dbcontext.Context, conn models.Connection) (*Client, error) + func (c *Client) Repository(rawURL string) (*Repository, error) + type CloneOptions struct + Depth int + Dir string + Ref string + type Commit struct + Author Signature + Body string + Date time.Time + Files []string + Parents []string + SHA string + ShortSHA string + Subject string + func (c Commit) IsMerge() bool + type CommitOptions struct + Author Signature + Message string + type Comparison struct + Ahead int + Behind int + MergeBase string + type DirtyStats struct + Conflicts int + Staged int + Unstaged int + Untracked int + func (s DirtyStats) Clean() bool + type FileChange struct + Content []byte + Delete bool + Path string + type InspectOptions struct + BranchHint string + RepositoryHint string + type LastCommit struct + Author string + CommittedAt time.Time + Subject string + type ListRepositoriesOptions struct + Namespace string + type LogOptions struct + Limit int + Paths []string + type Metadata struct + Branch string + Dirty DirtyStats + LastCommit LastCommit + Repository string + SHA string + func Inspect(ctx context.Context, dir string, options InspectOptions) (Metadata, error) + type Provider interface + ClosePullRequest func(ctx context.Context, repo RepoURL, number int) error + GetPullRequest func(ctx context.Context, repo RepoURL, number int) (PullRequest, error) + ListRepositories func(ctx context.Context, options ListRepositoriesOptions) ([]RepositoryInfo, error) + OpenPullRequest func(ctx context.Context, repo RepoURL, request PullRequestRequest) (PullRequest, error) + SupportsPullRequests func() bool + Type func() string + Verify func(ctx context.Context) error + type PullRequest struct + Base string + Head string + Number int + State PullRequestState + Title string + URL string + type PullRequestRequest struct + Assignees []string + AutoMerge bool + Base string + Body string + Draft bool + Head string + Labels []string + Reviewers []string + Title string + type PullRequestState string + const PullRequestClosed + const PullRequestMerged + const PullRequestOpen + type PushOptions struct + Branch string + ExpectedSHA string + Force bool + RemoteBranch string + ServerOptions []string + Tags []string + type Ref struct + Annotated bool + FullName string + Kind RefKind + Name string + SHA string + func Clone(ctx context.Context, repo *Repository, options CloneOptions) (Ref, error) + type RefKind string + const RefBranch + const RefHead + const RefSHA + const RefTag + type RemoteRefs struct + Branches []Ref + Head *Ref + Tags []Ref + func (r RemoteRefs) Resolve(name string) (Ref, error) + type RepoURL struct + Clone string + Depth *int + Host string + Name string + Owner string + Path string + Project string + Provider string + Ref string + Scheme string + User string + func ParseRepoURL(raw, providerHint string) (RepoURL, error) + func (u RepoURL) CacheKey() string + func (u RepoURL) FullName() string + func (u RepoURL) Redacted() string + func (u RepoURL) Short() string + type Repository struct + Auth Auth + Provider Provider + URL RepoURL + func NewRepository(options RepositoryOptions) (*Repository, error) + func (r *Repository) LsRemote(ctx context.Context) (RemoteRefs, error) + func (r *Repository) OpenPullRequest(ctx context.Context, request PullRequestRequest) (PullRequest, error) + func (r *Repository) Resolve(ctx context.Context, ref string) (Ref, error) + type RepositoryInfo struct + Archived bool + CloneURL string + DefaultBranch string + FullName string + Name string + Namespace string + Private bool + SSHURL string + WebURL string + type RepositoryOptions struct + Auth Auth + Provider Provider + ProviderType string + URL string + type Signature struct + Email string + Name string + func DefaultIdentity(ctx context.Context) (Signature, error) + type TLS struct + CA string + Cert string + InsecureSkipVerify bool + Key string + type TagOptions struct + Message string + Name string + Tagger Signature + type Worktree struct + Dir string + Ref Ref + func (w *Worktree) Commit(ctx context.Context, options CommitOptions) (string, error) + func (w *Worktree) CreateBranch(ctx context.Context, name string) error + func (w *Worktree) CreateTag(ctx context.Context, options TagOptions) error + func (w *Worktree) DeleteFile(path string) error + func (w *Worktree) Push(ctx context.Context, options PushOptions) error + func (w *Worktree) Release() error + func (w *Worktree) WriteFile(path string, content []byte) error