gittool

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddArgs

type AddArgs struct {
	RepoPath string   `json:"repoPath"`
	Paths    []string `json:"paths,omitempty"`
	All      bool     `json:"all,omitempty"`
}

type AddOut

type AddOut struct {
	RepoPath string   `json:"repoPath"`
	All      bool     `json:"all"`
	Paths    []string `json:"paths,omitempty"`
}

type BlameArgs

type BlameArgs struct {
	RepoPath   string `json:"repoPath"`
	Path       string `json:"path"`
	Revision   string `json:"revision,omitempty"`
	StartLine  int    `json:"startLine,omitempty"`
	EndLine    int    `json:"endLine,omitempty"`
	MaxCommits int    `json:"maxCommits,omitempty"`
}

type BlameLine

type BlameLine struct {
	LineNumber int        `json:"lineNumber"`
	Text       string     `json:"text"`
	Commit     CommitInfo `json:"commit"`
}

type BlameOut

type BlameOut struct {
	RepoPath   string      `json:"repoPath"`
	Path       string      `json:"path"`
	Revision   string      `json:"revision"`
	StartLine  int         `json:"startLine"`
	EndLine    int         `json:"endLine"`
	MaxCommits int         `json:"maxCommits"`
	Lines      []BlameLine `json:"lines"`
	Note       string      `json:"note,omitempty"`
}

type BlobEncoding

type BlobEncoding string
const (
	BlobEncodingAuto   BlobEncoding = "auto"
	BlobEncodingText   BlobEncoding = "text"
	BlobEncodingBase64 BlobEncoding = "base64"
)

type BranchInfo

type BranchInfo struct {
	Name    string     `json:"name"`
	Kind    BranchKind `json:"kind"`
	Hash    string     `json:"hash"`
	Current bool       `json:"current"`
}

type BranchKind

type BranchKind string
const (
	BranchKindLocal  BranchKind = "local"
	BranchKindRemote BranchKind = "remote"
	BranchKindAll    BranchKind = "all"
)

type BranchesArgs

type BranchesArgs struct {
	RepoPath string     `json:"repoPath"`
	Kind     BranchKind `json:"kind,omitempty"`
}

type BranchesOut

type BranchesOut struct {
	RepoPath string       `json:"repoPath"`
	Kind     BranchKind   `json:"kind"`
	Current  string       `json:"current,omitempty"`
	Branches []BranchInfo `json:"branches"`
}

type ChangedFileInfo

type ChangedFileInfo struct {
	Path     string `json:"path"`
	OldPath  string `json:"oldPath,omitempty"`
	Status   string `json:"status"`
	Staging  string `json:"staging,omitempty"`
	Worktree string `json:"worktree,omitempty"`
}

type ChangedFilesArgs

type ChangedFilesArgs struct {
	RepoPath string   `json:"repoPath"`
	Kind     DiffKind `json:"kind,omitempty"`
	Base     string   `json:"base,omitempty"`
	Target   string   `json:"target,omitempty"`
	Paths    []string `json:"paths,omitempty"`
	MaxCount int      `json:"maxCount,omitempty"`
}

type ChangedFilesOut

type ChangedFilesOut struct {
	RepoPath  string            `json:"repoPath"`
	Kind      DiffKind          `json:"kind"`
	Base      string            `json:"base,omitempty"`
	Target    string            `json:"target,omitempty"`
	Paths     []string          `json:"paths,omitempty"`
	MaxCount  int               `json:"maxCount"`
	Files     []ChangedFileInfo `json:"files"`
	Count     int               `json:"count"`
	Truncated bool              `json:"truncated"`
}

type CheckoutArgs

type CheckoutArgs struct {
	RepoPath   string `json:"repoPath"`
	Name       string `json:"name"`
	Create     bool   `json:"create,omitempty"`
	StartPoint string `json:"startPoint,omitempty"`
	Force      bool   `json:"force,omitempty"`
}

type CheckoutOut

type CheckoutOut struct {
	RepoPath    string `json:"repoPath"`
	Name        string `json:"name"`
	Created     bool   `json:"created"`
	Force       bool   `json:"force"`
	StartPoint  string `json:"startPoint,omitempty"`
	CurrentHead string `json:"currentHead,omitempty"`
	HeadHash    string `json:"headHash,omitempty"`
}

type CommitArgs

type CommitArgs struct {
	RepoPath    string `json:"repoPath"`
	Message     string `json:"message"`
	AuthorName  string `json:"authorName,omitempty"`
	AuthorEmail string `json:"authorEmail,omitempty"`
	All         bool   `json:"all,omitempty"`
}

type CommitInfo

type CommitInfo struct {
	Hash        string    `json:"hash"`
	ShortHash   string    `json:"shortHash"`
	AuthorName  string    `json:"authorName"`
	AuthorEmail string    `json:"authorEmail"`
	AuthorWhen  time.Time `json:"authorWhen"`
	Subject     string    `json:"subject"`
	Body        string    `json:"body,omitempty"`
}

type CommitOut

type CommitOut struct {
	RepoPath    string    `json:"repoPath"`
	Hash        string    `json:"hash"`
	ShortHash   string    `json:"shortHash"`
	AuthorName  string    `json:"authorName"`
	AuthorEmail string    `json:"authorEmail"`
	When        time.Time `json:"when"`
	All         bool      `json:"all"`
}

type CreateBranchArgs

type CreateBranchArgs struct {
	RepoPath   string `json:"repoPath"`
	Name       string `json:"name"`
	StartPoint string `json:"startPoint,omitempty"`
	Checkout   bool   `json:"checkout,omitempty"`
}

type CreateBranchOut

type CreateBranchOut struct {
	RepoPath    string `json:"repoPath"`
	Name        string `json:"name"`
	StartPoint  string `json:"startPoint"`
	Hash        string `json:"hash"`
	CheckedOut  bool   `json:"checkedOut"`
	CurrentHead string `json:"currentHead,omitempty"`
}

type CreateTagArgs

type CreateTagArgs struct {
	RepoPath    string `json:"repoPath"`
	Name        string `json:"name"`
	Target      string `json:"target,omitempty"`
	Message     string `json:"message,omitempty"`
	TaggerName  string `json:"taggerName,omitempty"`
	TaggerEmail string `json:"taggerEmail,omitempty"`
}

type CreateTagOut

type CreateTagOut struct {
	RepoPath        string    `json:"repoPath"`
	Name            string    `json:"name"`
	Target          string    `json:"target"`
	TargetHash      string    `json:"targetHash"`
	TargetShortHash string    `json:"targetShortHash"`
	TagHash         string    `json:"tagHash"`
	Annotated       bool      `json:"annotated"`
	Message         string    `json:"message,omitempty"`
	TaggerName      string    `json:"taggerName,omitempty"`
	TaggerEmail     string    `json:"taggerEmail,omitempty"`
	When            time.Time `json:"when,omitzero"`
	Action          string    `json:"action"`
}

type DeleteTagArgs

type DeleteTagArgs struct {
	RepoPath string `json:"repoPath"`
	Name     string `json:"name"`
}

type DeleteTagOut

type DeleteTagOut struct {
	RepoPath string `json:"repoPath"`
	Name     string `json:"name"`
	Hash     string `json:"hash"`
	Action   string `json:"action"`
}

type DiffArgs

type DiffArgs struct {
	RepoPath     string   `json:"repoPath"`
	Kind         DiffKind `json:"kind,omitempty"`
	Base         string   `json:"base,omitempty"`
	Target       string   `json:"target,omitempty"`
	Paths        []string `json:"paths,omitempty"`
	ContextLines *int     `json:"contextLines,omitempty"`
	MaxBytes     int      `json:"maxBytes,omitempty"`
}

type DiffKind

type DiffKind string
const (
	DiffKindWorking DiffKind = "working"
	DiffKindStaged  DiffKind = "staged"
	DiffKindRefs    DiffKind = "refs"
)

type DiffOut

type DiffOut struct {
	RepoPath           string     `json:"repoPath"`
	Kind               DiffKind   `json:"kind"`
	Base               string     `json:"base,omitempty"`
	Target             string     `json:"target,omitempty"`
	Paths              []string   `json:"paths,omitempty"`
	ContextLines       int        `json:"contextLines"`
	Diff               string     `json:"diff"`
	Bytes              int        `json:"bytes"`
	Truncated          bool       `json:"truncated"`
	OmittedBinaryFiles int        `json:"omittedBinaryFiles"`
	SkippedLargeFiles  int        `json:"skippedLargeFiles"`
	OutputMeta         OutputMeta `json:"outputMeta"`
}

type FileHistoryArgs

type FileHistoryArgs struct {
	RepoPath    string `json:"repoPath"`
	Path        string `json:"path"`
	Revision    string `json:"revision,omitempty"`
	MaxCommits  int    `json:"maxCommits,omitempty"`
	MaxWalk     int    `json:"maxWalk,omitempty"`
	FirstParent *bool  `json:"firstParent,omitempty"`
}

type FileHistoryCommit

type FileHistoryCommit struct {
	Commit CommitInfo `json:"commit"`
	Path   string     `json:"path"`
	Status string     `json:"status"`
}

type FileHistoryOut

type FileHistoryOut struct {
	RepoPath        string              `json:"repoPath"`
	Path            string              `json:"path"`
	Revision        string              `json:"revision"`
	MaxCommits      int                 `json:"maxCommits"`
	MaxWalk         int                 `json:"maxWalk"`
	FirstParent     bool                `json:"firstParent"`
	Commits         []FileHistoryCommit `json:"commits"`
	Count           int                 `json:"count"`
	Walked          int                 `json:"walked"`
	Truncated       bool                `json:"truncated"`
	RenameFollowing bool                `json:"renameFollowing"`
	Note            string              `json:"note,omitempty"`
}

type FindReposArgs

type FindReposArgs struct {
	RootPath       string `json:"rootPath"`
	MaxDepth       int    `json:"maxDepth,omitempty"`
	MaxRepos       int    `json:"maxRepos,omitempty"`
	MaxVisitedDirs int    `json:"maxVisitedDirs,omitempty"`
	IncludeBare    *bool  `json:"includeBare,omitempty"`
}

type FindReposOut

type FindReposOut struct {
	RootPath       string          `json:"rootPath"`
	MaxDepth       int             `json:"maxDepth"`
	MaxRepos       int             `json:"maxRepos"`
	MaxVisitedDirs int             `json:"maxVisitedDirs"`
	IncludeBare    bool            `json:"includeBare"`
	Repos          []FoundRepoInfo `json:"repos"`
	Count          int             `json:"count"`
	VisitedDirs    int             `json:"visitedDirs"`
	SkippedByDepth int             `json:"skippedByDepth"`
	Truncated      bool            `json:"truncated"`
}

type FoundRepoInfo

type FoundRepoInfo struct {
	RepoPath     string `json:"repoPath"`
	GitDir       string `json:"gitDir"`
	Bare         bool   `json:"bare"`
	Branch       string `json:"branch,omitempty"`
	HeadHash     string `json:"headHash,omitempty"`
	DetachedHead bool   `json:"detachedHead"`
	UnbornHead   bool   `json:"unbornHead"`
}

type GitTool

type GitTool struct {
	// contains filtered or unexported fields
}

GitTool is an instance-owned local Git tool runner.

It intentionally does not shell out to git. Implementations use pure Go Git operations and operate only on repositories supplied by input arguments.

Path handling follows the same broad pattern as FSTool:

  • workBaseDir: base for resolving relative repoPath values
  • allowedRoots: optional path allow-list
  • blockSymlinks: blocks symlink traversal when supported by the path policy

func NewGitTool

func NewGitTool(opts ...GitToolOption) (*GitTool, error)

func (*GitTool) Add

func (gt *GitTool) Add(ctx context.Context, args AddArgs) (*AddOut, error)

func (*GitTool) AddTool

func (gt *GitTool) AddTool() spec.Tool

func (*GitTool) Blame

func (gt *GitTool) Blame(ctx context.Context, args BlameArgs) (*BlameOut, error)

func (*GitTool) BlameTool

func (gt *GitTool) BlameTool() spec.Tool

func (*GitTool) Branches

func (gt *GitTool) Branches(ctx context.Context, args BranchesArgs) (*BranchesOut, error)

func (*GitTool) BranchesTool

func (gt *GitTool) BranchesTool() spec.Tool

func (*GitTool) ChangedFiles

func (gt *GitTool) ChangedFiles(ctx context.Context, args ChangedFilesArgs) (*ChangedFilesOut, error)

func (*GitTool) ChangedFilesTool

func (gt *GitTool) ChangedFilesTool() spec.Tool

func (*GitTool) Checkout

func (gt *GitTool) Checkout(ctx context.Context, args CheckoutArgs) (*CheckoutOut, error)

func (*GitTool) CheckoutTool

func (gt *GitTool) CheckoutTool() spec.Tool

func (*GitTool) Commit

func (gt *GitTool) Commit(ctx context.Context, args CommitArgs) (*CommitOut, error)

func (*GitTool) CommitTool

func (gt *GitTool) CommitTool() spec.Tool

func (*GitTool) CreateBranch

func (gt *GitTool) CreateBranch(ctx context.Context, args CreateBranchArgs) (*CreateBranchOut, error)

func (*GitTool) CreateBranchTool

func (gt *GitTool) CreateBranchTool() spec.Tool

func (*GitTool) CreateTag

func (gt *GitTool) CreateTag(ctx context.Context, args CreateTagArgs) (*CreateTagOut, error)

func (*GitTool) CreateTagTool

func (gt *GitTool) CreateTagTool() spec.Tool

func (*GitTool) DeleteTag

func (gt *GitTool) DeleteTag(ctx context.Context, args DeleteTagArgs) (*DeleteTagOut, error)

func (*GitTool) DeleteTagTool

func (gt *GitTool) DeleteTagTool() spec.Tool

func (*GitTool) Diff

func (gt *GitTool) Diff(ctx context.Context, args DiffArgs) (*DiffOut, error)

func (*GitTool) DiffTool

func (gt *GitTool) DiffTool() spec.Tool

func (*GitTool) FileHistory

func (gt *GitTool) FileHistory(ctx context.Context, args FileHistoryArgs) (*FileHistoryOut, error)

func (*GitTool) FileHistoryTool

func (gt *GitTool) FileHistoryTool() spec.Tool

func (*GitTool) FindRepos

func (gt *GitTool) FindRepos(ctx context.Context, args FindReposArgs) (*FindReposOut, error)

func (*GitTool) FindReposTool

func (gt *GitTool) FindReposTool() spec.Tool

func (*GitTool) Grep

func (gt *GitTool) Grep(ctx context.Context, args GrepArgs) (*GrepOut, error)

func (*GitTool) GrepTool

func (gt *GitTool) GrepTool() spec.Tool

func (*GitTool) Init

func (gt *GitTool) Init(ctx context.Context, args InitArgs) (*InitOut, error)

func (*GitTool) InitTool

func (gt *GitTool) InitTool() spec.Tool

func (*GitTool) ListTree

func (gt *GitTool) ListTree(ctx context.Context, args ListTreeArgs) (*ListTreeOut, error)

func (*GitTool) ListTreeTool

func (gt *GitTool) ListTreeTool() spec.Tool

func (*GitTool) Log

func (gt *GitTool) Log(ctx context.Context, args LogArgs) (*LogOut, error)

func (*GitTool) LogTool

func (gt *GitTool) LogTool() spec.Tool

func (*GitTool) ReadBlob

func (gt *GitTool) ReadBlob(ctx context.Context, args ReadBlobArgs) (*ReadBlobOut, error)

func (*GitTool) ReadBlobTool

func (gt *GitTool) ReadBlobTool() spec.Tool

func (*GitTool) RepoInfo

func (gt *GitTool) RepoInfo(ctx context.Context, args RepoInfoArgs) (*RepoInfoOut, error)

func (*GitTool) RepoInfoTool

func (gt *GitTool) RepoInfoTool() spec.Tool

func (*GitTool) Reset

func (gt *GitTool) Reset(ctx context.Context, args ResetArgs) (*ResetOut, error)

func (*GitTool) ResetTool

func (gt *GitTool) ResetTool() spec.Tool

func (*GitTool) Show

func (gt *GitTool) Show(ctx context.Context, args ShowArgs) (*ShowOut, error)

func (*GitTool) ShowTool

func (gt *GitTool) ShowTool() spec.Tool

func (*GitTool) Status

func (gt *GitTool) Status(ctx context.Context, args StatusArgs) (*StatusOut, error)

func (*GitTool) StatusTool

func (gt *GitTool) StatusTool() spec.Tool

func (*GitTool) Tags

func (gt *GitTool) Tags(ctx context.Context, args TagsArgs) (*TagsOut, error)

func (*GitTool) TagsTool

func (gt *GitTool) TagsTool() spec.Tool

type GitToolOption

type GitToolOption func(*GitTool) error

func WithAllowedRoots

func WithAllowedRoots(roots []string) GitToolOption

WithAllowedRoots restricts all repository paths to be within one of the provided roots. Roots are canonicalized by the shared filesystem policy.

func WithBlockSymlinks(block bool) GitToolOption

WithBlockSymlinks configures whether symlink traversal should be blocked.

func WithDefaultAuthor

func WithDefaultAuthor(name, email string) GitToolOption

WithDefaultAuthor sets the fallback author used by Commit when neither tool args nor repository config provide an author.

func WithWorkBaseDir

func WithWorkBaseDir(base string) GitToolOption

WithWorkBaseDir sets the base directory used to resolve relative repoPath values.

type GrepArgs

type GrepArgs struct {
	RepoPath     string   `json:"repoPath"`
	Pattern      string   `json:"pattern"`
	Revision     string   `json:"revision,omitempty"`
	Paths        []string `json:"paths,omitempty"`
	Literal      bool     `json:"literal,omitempty"`
	IgnoreCase   bool     `json:"ignoreCase,omitempty"`
	ContextLines *int     `json:"contextLines,omitempty"`
	MaxMatches   int      `json:"maxMatches,omitempty"`
	MaxFiles     int      `json:"maxFiles,omitempty"`
	MaxBytes     int      `json:"maxBytes,omitempty"`
}

type GrepMatch

type GrepMatch struct {
	Path       string   `json:"path"`
	LineNumber int      `json:"lineNumber"`
	Line       string   `json:"line"`
	Before     []string `json:"before,omitempty"`
	After      []string `json:"after,omitempty"`
}

type GrepOut

type GrepOut struct {
	RepoPath           string      `json:"repoPath"`
	Revision           string      `json:"revision"`
	Pattern            string      `json:"pattern"`
	Paths              []string    `json:"paths,omitempty"`
	Literal            bool        `json:"literal"`
	IgnoreCase         bool        `json:"ignoreCase"`
	ContextLines       int         `json:"contextLines"`
	MaxMatches         int         `json:"maxMatches"`
	MaxFiles           int         `json:"maxFiles"`
	MaxBytes           int         `json:"maxBytes"`
	Matches            []GrepMatch `json:"matches"`
	Count              int         `json:"count"`
	FilesVisited       int         `json:"filesVisited"`
	Truncated          bool        `json:"truncated"`
	OmittedBinaryFiles int         `json:"omittedBinaryFiles"`
	SkippedLargeFiles  int         `json:"skippedLargeFiles"`
	OutputMeta         OutputMeta  `json:"outputMeta"`
}

type IndexState

type IndexState struct {
	Entries       int      `json:"entries"`
	HasConflicts  bool     `json:"hasConflicts"`
	ConflictPaths []string `json:"conflictPaths,omitempty"`
}

type InitArgs

type InitArgs struct {
	RepoPath      string `json:"repoPath"`
	Bare          bool   `json:"bare,omitempty"`
	CreateParents bool   `json:"createParents,omitempty"`
}

type InitOut

type InitOut struct {
	RepoPath string `json:"repoPath"`
	GitDir   string `json:"gitDir"`
	Bare     bool   `json:"bare"`
	Action   string `json:"action"`
}

type ListTreeArgs

type ListTreeArgs struct {
	RepoPath    string `json:"repoPath"`
	Revision    string `json:"revision,omitempty"`
	Path        string `json:"path,omitempty"`
	Recursive   *bool  `json:"recursive,omitempty"`
	IncludeDirs bool   `json:"includeDirs,omitempty"`
	MaxEntries  int    `json:"maxEntries,omitempty"`
}

type ListTreeOut

type ListTreeOut struct {
	RepoPath    string          `json:"repoPath"`
	Revision    string          `json:"revision"`
	Path        string          `json:"path"`
	Recursive   bool            `json:"recursive"`
	IncludeDirs bool            `json:"includeDirs"`
	MaxEntries  int             `json:"maxEntries"`
	Entries     []TreeEntryInfo `json:"entries"`
	Count       int             `json:"count"`
	Truncated   bool            `json:"truncated"`
}

type LogArgs

type LogArgs struct {
	RepoPath string `json:"repoPath"`
	Revision string `json:"revision,omitempty"`
	MaxCount int    `json:"maxCount,omitempty"`
	Since    string `json:"since,omitempty"`
	Until    string `json:"until,omitempty"`
}

type LogOut

type LogOut struct {
	RepoPath string       `json:"repoPath"`
	Revision string       `json:"revision"`
	MaxCount int          `json:"maxCount"`
	Commits  []CommitInfo `json:"commits"`
}

type OutputMeta

type OutputMeta struct {
	Bytes              int  `json:"bytes"`
	Truncated          bool `json:"truncated"`
	OmittedBinaryFiles int  `json:"omittedBinaryFiles"`
	SkippedLargeFiles  int  `json:"skippedLargeFiles"`
	MaxBytes           int  `json:"maxBytes"`
}

type ReadBlobArgs

type ReadBlobArgs struct {
	RepoPath string       `json:"repoPath"`
	Revision string       `json:"revision,omitempty"`
	Path     string       `json:"path"`
	Encoding BlobEncoding `json:"encoding,omitempty"`
	MaxBytes int          `json:"maxBytes,omitempty"`
}

type ReadBlobOut

type ReadBlobOut struct {
	RepoPath       string       `json:"repoPath"`
	Revision       string       `json:"revision"`
	Path           string       `json:"path"`
	Mode           string       `json:"mode"`
	Hash           string       `json:"hash"`
	Size           int64        `json:"size"`
	Encoding       BlobEncoding `json:"encoding"`
	Content        string       `json:"content,omitempty"`
	Bytes          int          `json:"bytes"`
	Truncated      bool         `json:"truncated"`
	MaxBytes       int          `json:"maxBytes"`
	IsBinary       bool         `json:"isBinary"`
	ContentOmitted bool         `json:"contentOmitted"`
	OmissionReason string       `json:"omissionReason,omitempty"`
	OutputMeta     OutputMeta   `json:"outputMeta"`
}

type RemoteInfo

type RemoteInfo struct {
	Name string   `json:"name"`
	URLs []string `json:"urls"`
}

type RepoInfoArgs

type RepoInfoArgs struct {
	RepoPath string `json:"repoPath"`
}

type RepoInfoOut

type RepoInfoOut struct {
	RepoPath           string       `json:"repoPath"`
	GitDir             string       `json:"gitDir"`
	Bare               bool         `json:"bare"`
	HeadHash           string       `json:"headHash,omitempty"`
	Branch             string       `json:"branch,omitempty"`
	DetachedHead       bool         `json:"detachedHead"`
	UnbornHead         bool         `json:"unbornHead"`
	DefaultAuthorName  string       `json:"defaultAuthorName,omitempty"`
	DefaultAuthorEmail string       `json:"defaultAuthorEmail,omitempty"`
	Remotes            []RemoteInfo `json:"remotes,omitempty"`
	LocalBranchCount   int          `json:"localBranchCount"`
	RemoteBranchCount  int          `json:"remoteBranchCount"`
	TagCount           int          `json:"tagCount"`
	IndexState         IndexState   `json:"indexState,omitzero"`
}

type ResetArgs

type ResetArgs struct {
	RepoPath       string    `json:"repoPath"`
	Mode           ResetMode `json:"mode,omitempty"`
	Revision       string    `json:"revision,omitempty"`
	Paths          []string  `json:"paths,omitempty"`
	ConfirmDiscard bool      `json:"confirmDiscard,omitempty"`
}

type ResetMode

type ResetMode string
const (
	ResetModeMixed ResetMode = "mixed"
	ResetModeHard  ResetMode = "hard"
)

type ResetOut

type ResetOut struct {
	RepoPath          string    `json:"repoPath"`
	Mode              ResetMode `json:"mode"`
	Revision          string    `json:"revision"`
	HeadHash          string    `json:"headHash,omitempty"`
	Paths             []string  `json:"paths,omitempty"`
	DiscardedWorktree bool      `json:"discardedWorktree"`
	Action            string    `json:"action"`
}

type ShowArgs

type ShowArgs struct {
	RepoPath     string `json:"repoPath"`
	Revision     string `json:"revision,omitempty"`
	IncludePatch *bool  `json:"includePatch,omitempty"`
	MaxBytes     int    `json:"maxBytes,omitempty"`
}

type ShowOut

type ShowOut struct {
	RepoPath       string     `json:"repoPath"`
	Revision       string     `json:"revision"`
	Commit         CommitInfo `json:"commit"`
	ParentHashes   []string   `json:"parentHashes,omitempty"`
	Patch          string     `json:"patch,omitempty"`
	PatchBytes     int        `json:"patchBytes,omitempty"`
	PatchTruncated bool       `json:"patchTruncated,omitempty"`
	OutputMeta     OutputMeta `json:"outputMeta,omitzero"`
	Note           string     `json:"note,omitempty"`
}

type StatusArgs

type StatusArgs struct {
	RepoPath string `json:"repoPath"`
}

type StatusEntry

type StatusEntry struct {
	Path     string `json:"path"`
	Staging  string `json:"staging"`
	Worktree string `json:"worktree"`
}

type StatusOut

type StatusOut struct {
	RepoPath           string         `json:"repoPath"`
	HeadHash           string         `json:"headHash,omitempty"`
	Branch             string         `json:"branch,omitempty"`
	DetachedHead       bool           `json:"detachedHead"`
	UnbornHead         bool           `json:"unbornHead"`
	IsClean            bool           `json:"isClean"`
	DefaultAuthorName  string         `json:"defaultAuthorName,omitempty"`
	DefaultAuthorEmail string         `json:"defaultAuthorEmail,omitempty"`
	Remotes            []RemoteInfo   `json:"remotes,omitempty"`
	Entries            []StatusEntry  `json:"entries,omitempty"`
	Summary            map[string]int `json:"summary,omitempty"`
	IndexState         IndexState     `json:"indexState"`
}

type TagInfo

type TagInfo struct {
	Name        string    `json:"name"`
	Hash        string    `json:"hash"`
	ShortHash   string    `json:"shortHash"`
	Annotated   bool      `json:"annotated"`
	TargetHash  string    `json:"targetHash,omitempty"`
	TargetType  string    `json:"targetType,omitempty"`
	TaggerName  string    `json:"taggerName,omitempty"`
	TaggerEmail string    `json:"taggerEmail,omitempty"`
	TaggerWhen  time.Time `json:"taggerWhen,omitzero"`
	Message     string    `json:"message,omitempty"`
}

type TagsArgs

type TagsArgs struct {
	RepoPath string `json:"repoPath"`
	Pattern  string `json:"pattern,omitempty"`
}

type TagsOut

type TagsOut struct {
	RepoPath string    `json:"repoPath"`
	Pattern  string    `json:"pattern,omitempty"`
	Tags     []TagInfo `json:"tags"`
}

type TreeEntryInfo

type TreeEntryInfo struct {
	Path string       `json:"path"`
	Kind TreeModeKind `json:"kind"`
	Mode string       `json:"mode"`
	Hash string       `json:"hash"`
	Size int64        `json:"size,omitempty"`
}

type TreeModeKind

type TreeModeKind string
const (
	TreeModeKindTree      TreeModeKind = "tree"
	TreeModeKindSymlink   TreeModeKind = "symlink"
	TreeModeKindSubmodule TreeModeKind = "submodule"
	TreeModeKindBlob      TreeModeKind = "blob"
)

Jump to

Keyboard shortcuts

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