Documentation
¶
Overview ¶
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func Display(w io.Writer, a any, v term.Level) error
- func FindZetaDir(cwd string) (string, string, error)
- func GetConfig(opts *GetConfigOptions) error
- func IsErrNotZetaDir(err error) bool
- func IsErrUnknownRevision(err error) bool
- func IsExitCode(err error, i int) bool
- func ListConfig(opts *ListConfigOptions) error
- func LookupAria2c() (string, error)
- func LookupDragonflyGet() (string, error)
- func NewBuiltinPrinter(ctx context.Context) *printer
- func NewPrinter(ctx context.Context) *printer
- func ParseBool(str string) (bool, error)
- func ReadText(p string, textconv bool) (string, error)
- func ReferencesSort(rs References, order string) error
- func StatusName(c StatusCode) string
- func UnsetConfig(opts *UnsetConfigOptions) error
- func UpdateConfig(opts *UpdateConfigOptions) error
- type AddOptions
- type BlameResult
- type BranchEntry
- type CatOptions
- type CheckIgnoreOption
- type CheckoutOptions
- type CherryPickOptions
- type Chunker
- type CleanOptions
- type CommitOptions
- type CommitTreeOptions
- type Content
- type DiffOptions
- type DoFetchOptions
- type ErrExitCode
- type ErrNotZetaDir
- type ErrUnknownRevision
- type FetchOptions
- type FetchResult
- type FileStatus
- type FileStatusJSON
- type ForEachReferenceOptions
- type GcOptions
- type GetConfigOptions
- type GrepOptions
- type GrepResult
- type InitOptions
- type JsonTreeEntry
- type Line
- type ListBranchOptions
- type ListConfigOptions
- type ListFilesMode
- type ListTagOptions
- type LogCommandOptions
- type LogOptions
- type LogOrder
- type LsFilesOptions
- type LsTreeOptions
- type Matcher
- type MergeFileOptions
- type MergeOptions
- type MergeTreeOptions
- type NewOptions
- type NewTagOptions
- type NopWriteCloser
- type OpenOptions
- type Printer
- type ProgressBar
- type PullOptions
- type PushOptions
- type RebaseMD
- type RebaseOptions
- type Reference
- type ReferenceLite
- type References
- type ReferencesEx
- type RemoteInfo
- type RemoveOptions
- type RenameOptions
- type ReplayMD
- type Repository
- func (r *Repository) Accelerator() config.Accelerator
- func (r *Repository) BaseDir() string
- func (r *Repository) Cat(ctx context.Context, opts *CatOptions) error
- func (r *Repository) Close() error
- func (r *Repository) CommitTree(ctx context.Context, opts *CommitTreeOptions) (plumbing.Hash, error)
- func (r *Repository) ConcurrentTransfers() int
- func (r *Repository) CreateBranch(ctx context.Context, newBranch, from string, force bool, fetchMissing bool) error
- func (r *Repository) Current() (*plumbing.Reference, error)
- func (r *Repository) Debug(format string, args ...any)
- func (r *Repository) DoFetch(ctx context.Context, opts *DoFetchOptions) (*FetchResult, error)
- func (r *Repository) DoUpdate(ctx context.Context, refname plumbing.ReferenceName, ...) error
- func (r *Repository) FetchObjects(ctx context.Context, commit plumbing.Hash, skipLarges bool) error
- func (r *Repository) ForEachReference(ctx context.Context, opts *ForEachReferenceOptions) error
- func (r *Repository) Gc(ctx context.Context, opts *GcOptions) error
- func (r *Repository) Grep(ctx context.Context, opts *GrepOptions) ([]GrepResult, error)
- func (r *Repository) HashTo(ctx context.Context, reader io.Reader, size int64) (oid plumbing.Hash, fragments bool, err error)
- func (r *Repository) IsAncestor(ctx context.Context, a, b string) error
- func (r *Repository) IsCurrent(refname plumbing.ReferenceName) bool
- func (r *Repository) IsExtreme() bool
- func (r *Repository) ListBranch(ctx context.Context, opts *ListBranchOptions) error
- func (r *Repository) ListTag(ctx context.Context, opts *ListTagOptions) error
- func (r *Repository) Log(ctx context.Context, opts *LogCommandOptions) error
- func (r *Repository) LsTree(ctx context.Context, opts *LsTreeOptions) error
- func (r *Repository) LsTreeRecurse(ctx context.Context, opts *LsTreeOptions, t *object.Tree, m *Matcher) error
- func (r *Repository) MergeBase(ctx context.Context, revisions []string, all bool) error
- func (r *Repository) MergeFile(ctx context.Context, opts *MergeFileOptions) error
- func (r *Repository) MergeTree(ctx context.Context, opts *MergeTreeOptions) error
- func (r *Repository) MoveBranch(from, to string, force bool) error
- func (r *Repository) NewCommitter() *object.Signature
- func (r *Repository) NewTag(ctx context.Context, opts *NewTagOptions) error
- func (r *Repository) ODB() *odb.ODB
- func (r *Repository) PickAncestor(ctx context.Context, oid plumbing.Hash, n int) (plumbing.Hash, error)
- func (r *Repository) Postflight(ctx context.Context) error
- func (r *Repository) Push(ctx context.Context, o *PushOptions) error
- func (r *Repository) RDB() refs.Backend
- func (r *Repository) ReferenceExists(ctx context.Context, refname string) error
- func (r *Repository) ReferenceResolve(name plumbing.ReferenceName) (ref *plumbing.Reference, err error)
- func (r *Repository) ReferencesEx(ctx context.Context) (*ReferencesEx, error)
- func (r *Repository) RemoveBranch(branches []string, force bool) error
- func (r *Repository) RemoveTag(tags []string) error
- func (r *Repository) Revision(ctx context.Context, branchOrTag string) (plumbing.Hash, error)
- func (r *Repository) RevisionEx(ctx context.Context, revision string) (plumbing.Hash, plumbing.ReferenceName, error)
- func (r *Repository) Show(ctx context.Context, opts *ShowOptions) error
- func (r *Repository) ShowCurrent(w io.Writer) error
- func (r *Repository) ShowRemote(opts *ShowRemoteOptions) error
- func (r *Repository) SwitchBranch(ctx context.Context, branch string, so *SwitchOptions) error
- func (r *Repository) SwitchDetach(ctx context.Context, basePoint string, so *SwitchOptions) error
- func (r *Repository) SwitchNewBranch(ctx context.Context, newBranch string, basePoint string, so *SwitchOptions) error
- func (r *Repository) SwitchOrphan(ctx context.Context, newBranch string, so *SwitchOptions) error
- func (r *Repository) Worktree() *Worktree
- func (r *Repository) WriteEncoded(e object.Encoder) (oid plumbing.Hash, err error)
- func (r *Repository) ZetaDir() string
- type ResetMode
- type ResetOptions
- type RestoreOptions
- type RevertOptions
- type SafeTensorsFile
- type ShowOptions
- type ShowRemoteOptions
- type Span
- type StageItem
- type StashEntry
- type StashListOptions
- type StashPushOptions
- type Status
- type StatusCode
- type StatusJSON
- type StringArray
- type SwitchOptions
- type TagEntry
- type TensorEntry
- type UnsetConfigOptions
- type UpdateConfigOptions
- type Worktree
- func (w *Worktree) Add(ctx context.Context, pathSpec []string, dryRun bool) error
- func (w *Worktree) AddGlob(ctx context.Context, pattern string, dryRun bool) error
- func (w *Worktree) AddTracked(ctx context.Context, pathSpec []string, dryRun bool) error
- func (w *Worktree) AddWithOptions(ctx context.Context, opts *AddOptions) error
- func (w *Worktree) Checkout(ctx context.Context, opts *CheckoutOptions) error
- func (w *Worktree) CherryPick(ctx context.Context, opts *CherryPickOptions) error
- func (w *Worktree) Chmod(ctx context.Context, paths []string, mask bool, dryRun bool) error
- func (w *Worktree) Clean(ctx context.Context, opts *CleanOptions) error
- func (w *Worktree) Commit(ctx context.Context, opts *CommitOptions) (plumbing.Hash, error)
- func (w *Worktree) DiffContext(ctx context.Context, opts *DiffOptions) error
- func (w *Worktree) DiffTreeWithIndex(ctx context.Context, oid plumbing.Hash, opts *DiffOptions) error
- func (w *Worktree) DiffTreeWithWorktree(ctx context.Context, oid plumbing.Hash, opts *DiffOptions) error
- func (w *Worktree) DoBatchCo(ctx context.Context, oneByOne bool, revision string, r io.Reader) error
- func (w *Worktree) DoCheckIgnore(ctx context.Context, opts *CheckIgnoreOption) error
- func (w *Worktree) DoPathCo(ctx context.Context, worktreeOnly bool, oid plumbing.Hash, pathSpec []string) error
- func (w *Worktree) Grep(ctx context.Context, opts *GrepOptions) ([]GrepResult, error)
- func (w *Worktree) LsFiles(ctx context.Context, opts *LsFilesOptions) error
- func (w *Worktree) Merge(ctx context.Context, opts *MergeOptions) error
- func (w *Worktree) Prefetch(ctx context.Context, revision string, limit int64, skipLarge bool) (plumbing.Hash, error)
- func (w *Worktree) Pull(ctx context.Context, opts *PullOptions) error
- func (w *Worktree) Rebase(ctx context.Context, opts *RebaseOptions) error
- func (w *Worktree) Remove(ctx context.Context, patterns []string, opts *RemoveOptions) error
- func (w *Worktree) RemoveGlob(pattern string) error
- func (w *Worktree) RemoveLegacy(path string) (plumbing.Hash, error)
- func (w *Worktree) Rename(ctx context.Context, source, destination string, opts *RenameOptions) error
- func (w *Worktree) Reset(ctx context.Context, opts *ResetOptions) error
- func (w *Worktree) ResetSparsely(ctx context.Context, opts *ResetOptions, bar ProgressBar) error
- func (w *Worktree) ResetSpec(ctx context.Context, oid plumbing.Hash, pathSpec []string) error
- func (w *Worktree) Restore(ctx context.Context, opts *RestoreOptions) error
- func (w *Worktree) Revert(ctx context.Context, opts *RevertOptions) error
- func (w *Worktree) ShowFs(verbose bool)
- func (w *Worktree) ShowStatus(status Status, short bool, z bool)
- func (w *Worktree) ShowStatusJSON(status Status) error
- func (w *Worktree) StashApply(ctx context.Context, stashRev string) error
- func (w *Worktree) StashClear(ctx context.Context) error
- func (w *Worktree) StashDrop(ctx context.Context, stashRev string) error
- func (w *Worktree) StashList(ctx context.Context, opts *StashListOptions) error
- func (w *Worktree) StashPop(ctx context.Context, stashRev string) error
- func (w *Worktree) StashPush(ctx context.Context, opts *StashPushOptions) error
- func (w *Worktree) StashShow(ctx context.Context, stashRev string) error
- func (w *Worktree) Stats(ctx context.Context) error
- func (w *Worktree) Status(ctx context.Context, verbose bool) (Status, error)
- type WrapPrinter
Constants ¶
const ( COMMIT_EDITMSG = "COMMIT_EDITMSG" TAG_EDITMSG = "TAG_EDITMSG" MERGE_MSG = "MERGE_MSG" )
const ( ENV_ZETA_CORE_ACCELERATOR = "ZETA_CORE_ACCELERATOR" ENV_ZETA_CORE_OPTIMIZE_STRATEGY = "ZETA_CORE_OPTIMIZE_STRATEGY" ENV_ZETA_CORE_CONCURRENT_TRANSFERS = "ZETA_CORE_CONCURRENT_TRANSFERS" ENV_ZETA_CORE_SHARING_ROOT = "ZETA_CORE_SHARING_ROOT" ENV_ZETA_CORE_PROMISOR = "ZETA_CORE_PROMISOR" ENV_ZETA_AUTHOR_NAME = "ZETA_AUTHOR_NAME" ENV_ZETA_AUTHOR_EMAIL = "ZETA_AUTHOR_EMAIL" ENV_ZETA_AUTHOR_DATE = "ZETA_AUTHOR_DATE" ENV_ZETA_COMMITTER_NAME = "ZETA_COMMITTER_NAME" ENV_ZETA_COMMITTER_EMAIL = "ZETA_COMMITTER_EMAIL" ENV_ZETA_COMMITTER_DATE = "ZETA_COMMITTER_DATE" ENV_ZETA_MERGE_TEXT_DRIVER = "ZETA_MERGE_TEXT_DRIVER" ENV_ZETA_EDITOR = "ZETA_EDITOR" ENV_ZETA_SSL_NO_VERIFY = "ZETA_SSL_NO_VERIFY" ENV_ZETA_TRANSPORT_MAX_ENTRIES = "ZETA_TRANSPORT_MAX_ENTRIES" ENV_ZETA_TRANSPORT_LARGE_SIZE = "ZETA_TRANSPORT_LARGE_SIZE" ENV_ZETA_TRANSPORT_EXTERNAL_PROXY = "ZETA_TRANSPORT_EXTERNAL_PROXY" ENV_ZETA_CREDENTIAL_STORAGE = "ZETA_CREDENTIAL_STORAGE" ENV_ZETA_CREDENTIAL_ENCRYPTION_KEY = "ZETA_CREDENTIAL_ENCRYPTION_KEY" ENV_ZETA_CREDENTIAL_STORAGE_PATH = "ZETA_CREDENTIAL_STORAGE_PATH" )
const (
AnySize = -1
)
const (
ENV_ZETA_EXTENSION_ARIA2C = "ZETA_EXTENSION_ARIA2C"
)
const (
ENV_ZETA_EXTENSION_DRAGONFLY_GET = "ZETA_EXTENSION_DRAGONFLY_GET"
)
const (
MAX_SHOW_BINARY_BLOB = 10<<20 - 8
)
const (
NUL = '\x00'
)
const (
REBASE_MD = "REBASE-MD"
)
const (
REPLAY_MD = "REPLAY-MD"
)
const (
StashName plumbing.ReferenceName = "refs/stash"
)
const (
// ZetaDirName this is a special folder where all the zeta stuff is.
ZetaDirName = ".zeta"
)
Variables ¶
var ( ErrMissingKeys = errors.New("missing keys") ErrOnlyOneName = errors.New("only one config file at a time") )
var ( ErrHasConflicts = errors.New("merge: there are conflicting files") ErrNotAncestor = errors.New("merge-base: not ancestor") )
var ( ErrBranchHashExclusive = errors.New("branch and Hash are mutually exclusive") ErrCreateRequiresBranch = errors.New("branch is mandatory when Create is used") )
var ( ErrNotSafeTensors = errors.New("not a safetensors file") ErrInvalidHeaderSize = errors.New("invalid safetensors header size") )
SafeTensors errors.
var ( ErrWorktreeNotEmpty = errors.New("worktree not empty") ErrWorktreeNotClean = errors.New("worktree is not clean") ErrUnstagedChanges = errors.New("worktree contains unstaged changes") ErrNonFastForwardUpdate = errors.New("non-fast-forward update") )
var ( ErrNotTreeNoder = errors.New("not tree noder") ErrNotIndexNode = errors.New("not index node") )
var ( // ErrNoChanges occurs when a commit is attempted using a clean // working tree, with no changes to be committed. ErrNoChanges = errors.New("clean working tree") ErrNotAllowEmptyMessage = errors.New("not allow empty message") ErrNothingToCommit = errors.New("nothing to commit") )
var ( // ErrDestinationExists in an Move operation means that the target exists on // the worktree. ErrDestinationExists = errors.New("destination exists") // ErrGlobNoMatches in an AddGlob if the glob pattern does not match any // files in the worktree. ErrGlobNoMatches = errors.New("glob pattern did not match any files") )
var (
ErrAborting = errors.New("aborting")
)
var (
ErrHasUnstaged = errors.New("has unstaged")
)
var (
ErrHashOrReference = errors.New("ambiguous options, only one of CommitHash or ReferenceName can be passed")
)
var (
ErrHaveCommits = errors.New("have commits")
)
var (
ErrMissingAuthor = errors.New("author field is required")
)
var (
ErrNotAStashLikeCommit = errors.New("not a stash-like commit")
)
var (
ErrNotAllowedRemoveCurrent = errors.New("not allowed remove HEAD")
)
var (
ErrNotTree = errors.New("not tree")
)
var (
ErrPushRejected = errors.New("push rejected")
)
var (
W = tr.W // translate func wrap
)
Functions ¶
func FindZetaDir ¶
FindZetaDir return worktreeDir, zetaDir, err
func GetConfig ¶
func GetConfig(opts *GetConfigOptions) error
func IsErrNotZetaDir ¶
func IsErrUnknownRevision ¶
func IsExitCode ¶ added in v0.16.0
func ListConfig ¶
func ListConfig(opts *ListConfigOptions) error
func LookupAria2c ¶
func LookupDragonflyGet ¶
func NewBuiltinPrinter ¶ added in v0.23.0
NewBuiltinPrinter creates a printer backed by the built-in TUI pager.
func NewPrinter ¶
func ParseBool ¶
ParseBool returns the boolean value represented by the string. It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False. Any other value returns an error.
func ReferencesSort ¶
func ReferencesSort(rs References, order string) error
objectsize authordate committerdate creatordate taggerdate
func StatusName ¶
func StatusName(c StatusCode) string
func UnsetConfig ¶
func UnsetConfig(opts *UnsetConfigOptions) error
func UpdateConfig ¶
func UpdateConfig(opts *UpdateConfigOptions) error
Types ¶
type AddOptions ¶
type AddOptions struct {
// All equivalent to `git add -A`, update the index not only where the
// working tree has a file matching `Path` but also where the index already
// has an entry. This adds, modifies, and removes index entries to match the
// working tree. If no `Path` nor `Glob` is given when `All` option is
// used, all files in the entire working tree are updated.
All bool
// Path is the exact filepath to the file or directory to be added.
Path string
// Glob adds all paths, matching pattern, to the index. If pattern matches a
// directory path, all directory contents are added to the index recursively.
Glob string
// SkipStatus adds the path with no status check. This option is relevant only
// when the `Path` option is specified and does not apply when the `All` option is used.
// Notice that when passing an ignored path it will be added anyway.
// When true it can speed up adding files to the worktree in very large repositories.
SkipStatus bool
DryRun bool
}
AddOptions describes how an `add` operation should be performed
func (*AddOptions) Validate ¶
func (o *AddOptions) Validate(r *Repository) error
Validate validates the fields and sets the default values.
type BlameResult ¶ added in v0.16.0
type BlameResult struct {
// Path is the path of the File that we're blaming.
Path string
// Rev (Revision) is the hash of the specified Commit used to generate this result.
Rev plumbing.Hash
// Lines contains every line with its authorship.
Lines []*Line
}
BlameResult represents the result of a Blame operation.
func Blame ¶ added in v0.16.0
Blame returns a BlameResult with the information about the last author of each line from file `path` at commit `c`.
func (BlameResult) String ¶ added in v0.16.0
func (b BlameResult) String() string
String prints the results of a Blame using git-blame's style.
type BranchEntry ¶ added in v0.24.0
type BranchEntry struct {
Name string `json:"name"`
Current bool `json:"current,omitempty"`
Hash plumbing.Hash `json:"hash"`
}
BranchEntry is the JSON representation of a branch.
type CatOptions ¶
type CatOptions struct {
Object string
Limit int64 // blob limit size
Type bool // object type
PrintSize bool
PrintJSON bool
Verify bool
Textconv bool
Direct bool
Output string
// Image controls inline image rendering for binary blobs.
// Empty string is treated as "auto" (honour detected terminal capability).
// See term.ParseImageMode for accepted values.
Image string
}
func (*CatOptions) NewFD ¶ added in v0.16.0
func (opts *CatOptions) NewFD() (io.WriteCloser, term.Level, error)
func (*CatOptions) Println ¶ added in v0.16.0
func (opts *CatOptions) Println(a ...any) error
type CheckIgnoreOption ¶
type CheckoutOptions ¶
type CheckoutOptions struct {
// Hash is the hash of the commit to be checked out. If used, HEAD will be
// in detached mode. If Create is not used, Branch and Hash are mutually
// exclusive.
Hash plumbing.Hash
// Branch to be checked out, if Branch and Hash are empty is set to `master`.
Branch plumbing.ReferenceName
// Create a new branch named Branch and start it at Hash.
Create bool
Force bool
Merge bool
First bool
One bool
Quiet bool
}
CheckoutOptions describes how a checkout operation should be performed.
func (*CheckoutOptions) Validate ¶
func (o *CheckoutOptions) Validate() error
Validate validates the fields and sets the default values.
type CherryPickOptions ¶
type Chunker ¶ added in v0.24.0
type Chunker struct {
// contains filtered or unexported fields
}
Chunker implements the FastCDC content-defined chunking algorithm.
Reference: Xia et al., "FastCDC: A Fast and Efficient Content-Defined Chunking Approach for Data Deduplication", USENIX ATC 2016. https://www.usenix.org/node/196197
Three-phase normalized chunking:
minSize <= size < normalSize : maskShort (more bits → harder to cut, keeps small chunks growing) normalSize <= size < normalSize+normalSpan : maskNormal (target probability) size >= normalSize+normalSpan && size<maxSize: maskLong (fewer bits → easier to cut, closes off large chunks) size >= maxSize : force cut
Note: previous revisions of this code had the maskShort / maskLong probabilities swapped relative to the paper, which biased average chunk size well below the configured target. PR-2 fixes the direction.
func NewChunker ¶ added in v0.24.0
NewChunker creates a FastCDC chunker tuned around the given target size.
Default normalization:
minSize = max(target/4, 64KiB) maxSize = min(target*8, 64MiB) normal = target
func (*Chunker) Split ¶ added in v0.24.0
Split scans the reader and returns chunk boundaries without retaining data.
Use this when you only need the boundaries (e.g. for analysis or tests). For production chunking with hashing, prefer Walk.
Tail handling: if the final chunk would be shorter than minSize, it is merged into the previous chunk to avoid pathologically small metadata.
func (*Chunker) Walk ¶ added in v0.24.0
Walk scans the reader and invokes onChunk for each chunk boundary, passing a reader over the chunk's data.
IMPORTANT: this is not zero-buffer streaming. CDC needs to read bytes to compute the rolling hash before it can know where to cut, so the chunker buffers up to maxSize bytes between boundaries. This matches the standard CDC trade-off used by restic, borg, and similar tools. Memory usage is O(maxSize), independent of input size.
CONTRACT: onChunk must fully consume the supplied reader before returning; the underlying buffer is reused for the next chunk.
Tail handling: if the final chunk would be shorter than minSize, it is merged into the previous chunk by buffering across the previous emit. The implementation realizes this by deferring emit until either the buffer reaches a real boundary or the stream ends.
type CleanOptions ¶
type CleanOptions struct {
// dry run
DryRun bool
// Dir recurses into nested directories.
Dir bool
// All removes all changes, even those excluded by gitignore.
All bool
}
CleanOptions describes how a clean should be performed.
type CommitOptions ¶
type CommitOptions struct {
// All automatically stage files that have been modified and deleted, but
// new files you have not told Git about are not affected.
All bool
// AllowEmptyCommits enable empty commits to be created. An empty commit
// is when no changes to the tree were made, but a new commit message is
// provided. The default behavior is false, which results in ErrEmptyCommit.
AllowEmptyCommits bool
// Author is the author's signature of the commit. If Author is empty the
// Name and Email is read from the config, and time.Now it's used as When.
Author object.Signature
// Committer is the committer's signature of the commit. If Committer is
// nil the Author signature is used.
Committer object.Signature
// Parents are the parents commits for the new commit, by default when
// len(Parents) is zero, the hash of HEAD reference is used.
Parents []plumbing.Hash
// SignKey denotes a key to sign the commit with. A nil value here means the
// commit will not be signed. The private key must be present and already
// decrypted.
SignKey *openpgp.Entity
// Amend will create a new commit object and replace the commit that HEAD currently
// points to. Cannot be used with All nor Parents.
Amend bool
AllowEmptyMessage bool
Message []string
File string
}
CommitOptions describes how a commit operation should be performed.
func (*CommitOptions) Validate ¶
func (o *CommitOptions) Validate(r *Repository) error
Validate validates the fields and sets the default values.
type CommitTreeOptions ¶
type CommitTreeOptions struct {
Tree plumbing.Hash
// Author is the author's signature of the commit. If Author is empty the
// Name and Email is read from the config, and time.Now it's used as When.
Author object.Signature
// Committer is the committer's signature of the commit. If Committer is
// nil the Author signature is used.
Committer object.Signature
// Parents are the parents commits for the new commit, by default when
// len(Parents) is zero, the hash of HEAD reference is used.
Parents []plumbing.Hash
// SignKey denotes a key to sign the commit with. A nil value here means the
// commit will not be signed. The private key must be present and already
// decrypted.
SignKey *openpgp.Entity
// Amend will create a new commit object and replace the commit that HEAD currently
// points to. Cannot be used with All nor Parents.
Message string
}
type DiffOptions ¶ added in v0.15.0
type DiffOptions struct {
NameOnly bool
NameStatus bool // name status
Numstat bool
Stat bool
Shortstat bool
Staged bool
JSON bool
NewLine byte
NewOutput func(context.Context) (Printer, error) // new writer func
NoRename bool
// index value
MergeBase string
From string
To string
PathSpec []string
Textconv bool
UseColor bool
ThreeWay bool
Algorithm diferenco.Algorithm
}
func (*DiffOptions) ShowChanges ¶ added in v0.15.0
func (*DiffOptions) ShowStats ¶ added in v0.16.0
ShowStats: show stats
Original implementation: https://github.com/git/git/blob/1a87c842ece327d03d08096395969aca5e0a6996/diff.c#L2615 Parts of the output: <pad><filename><pad>|<pad><changeNumber><pad><+++/---><newline> example: " main.go | 10 +++++++--- "
type DoFetchOptions ¶
type DoFetchOptions struct {
Name string
Unshallow bool
Limit int64
Tag bool
Force bool
FetchAlways bool
SkipLarges bool
}
func (*DoFetchOptions) ReferenceName ¶
func (opts *DoFetchOptions) ReferenceName() plumbing.ReferenceName
type ErrExitCode ¶
func (*ErrExitCode) Error ¶
func (e *ErrExitCode) Error() string
type ErrNotZetaDir ¶
type ErrNotZetaDir struct {
// contains filtered or unexported fields
}
ErrNotExist commit not exist error
func (*ErrNotZetaDir) Error ¶
func (err *ErrNotZetaDir) Error() string
type ErrUnknownRevision ¶
type ErrUnknownRevision struct {
// contains filtered or unexported fields
}
func (*ErrUnknownRevision) Error ¶
func (e *ErrUnknownRevision) Error() string
type FetchOptions ¶
type FileStatus ¶
type FileStatus struct {
// Staging is the status of a file in the staging area
Staging StatusCode
// Worktree is the status of a file in the worktree
Worktree StatusCode
// Extra contains extra information, such as the previous name in a rename
Extra string
}
FileStatus contains the status of a file in the worktree
type FileStatusJSON ¶ added in v0.24.0
type FileStatusJSON struct {
Path string `json:"path"`
Staging StatusCode `json:"staging,omitempty"`
Worktree StatusCode `json:"worktree,omitempty"`
Extra string `json:"extra,omitempty"`
}
FileStatusJSON is the JSON representation of a FileStatus.
type ForEachReferenceOptions ¶
type GetConfigOptions ¶
type GrepOptions ¶
type GrepOptions struct {
// Patterns are compiled Regexp objects to be matched.
Patterns []*regexp.Regexp
// InvertMatch selects non-matching lines.
InvertMatch bool
// CommitHash is the hash of the commit from which worktree should be derived.
CommitHash plumbing.Hash
// ReferenceName is the branch or tag name from which worktree should be derived.
ReferenceName plumbing.ReferenceName
// PathSpecs are compiled Regexp objects of pathspec to use in the matching.
PathSpecs []*regexp.Regexp
// Size Limit
Limit int64
}
GrepOptions describes how a grep should be performed.
func (*GrepOptions) Validate ¶
func (o *GrepOptions) Validate(w *Worktree) error
Validate validates the fields and sets the default values.
TODO: deprecate in favor of Validate(r *Repository) in v6.
type GrepResult ¶
type GrepResult struct {
// FileName is the name of file which contains match.
FileName string
// LineNumber is the line number of a file at which a match was found.
LineNumber int
// Content is the content of the file at the matching line.
Content string
// TreeName is the name of the tree (reference name/commit hash) at
// which the match was performed.
TreeName string
}
GrepResult is structure of a grep result.
func (GrepResult) String ¶
func (gr GrepResult) String() string
type InitOptions ¶
type JsonTreeEntry ¶
type Line ¶ added in v0.16.0
type Line struct {
// Author is the email address of the last author that modified the line.
Author string
// AuthorName is the name of the last author that modified the line.
AuthorName string
// Text is the original text of the line.
Text string
// Date is when the original text of the line was introduced
Date time.Time
// Hash is the commit hash that introduced the original line
Hash plumbing.Hash
}
Line values represent the contents and author of a line in BlamedResult values.
type ListBranchOptions ¶ added in v0.24.0
type ListConfigOptions ¶
type ListFilesMode ¶
type ListFilesMode int
const ( ListFilesCached ListFilesMode = iota ListFilesDeleted ListFilesModified ListFilesOthers //ListFilesIgnored ListFilesStage )
type ListTagOptions ¶ added in v0.24.0
type LogCommandOptions ¶ added in v0.17.2
type LogCommandOptions struct {
Revision string
Order LogOrder
OrderByCommitterDate bool
OrderByAuthorDate bool
Reverse bool
FormatJSON bool
JSONLimit int
Paths []string
}
func (*LogCommandOptions) SortFunc ¶ added in v0.17.2
func (o *LogCommandOptions) SortFunc() commitsSortFunc
type LogOptions ¶
type LogOptions struct {
// When the From option is set the log will only contain commits
// reachable from it. If this option is not set, HEAD will be used as
// the default From.
From plumbing.Hash
// The default traversal algorithm is Depth-first search
// set Order=LogOrderCommitterTime for ordering by committer time (more compatible with `git log`)
// set Order=LogOrderBFS for Breadth-first search
Order LogOrder
// Show only those commits in which the specified file was inserted/updated.
// It is equivalent to running `zeta log -- <file-name>`.
// this field is kept for compatibility, it can be replaced with PathFilter
FileName *string
// Filter commits based on the path of files that are updated
// takes file path as argument and should return true if the file is desired
// It can be used to implement `zeta log -- <path>`
// either <path> is a file path, or directory path, or a regexp of file/directory path
PathFilter func(string) bool
// Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as <commit>.
// It is equivalent to running `zeta log --all`.
// If set on true, the From option will be ignored.
All bool
// Show commits more recent than a specific date.
// It is equivalent to running `zeta log --since <date>` or `zeta log --after <date>`.
Since *time.Time
// Show commits older than a specific date.
// It is equivalent to running `zeta log --until <date>` or `zeta log --before <date>`.
Until *time.Time
//
Reverse bool
}
LogOptions describes how a log action should be performed.
type LsFilesOptions ¶
type LsFilesOptions struct {
Mode ListFilesMode
Z bool
JSON bool
Paths []string
}
type LsTreeOptions ¶
type LsTreeOptions struct {
OnlyTrees bool
Recurse bool
Tree bool
NewLine byte
Long bool
NameOnly bool
Abbrev int
Revision string
Paths []string
JSON bool
}
func (*LsTreeOptions) Rev ¶
func (opts *LsTreeOptions) Rev() string
type MergeFileOptions ¶ added in v0.16.0
type MergeOptions ¶
type MergeOptions struct {
From string // From branch
// Requires a merge to be fast forward only. If this is true, then a merge will
// throw an error if ff is not possible.
FFOnly bool
FF bool
Squash bool
Signoff bool
MergeOptions describes how a merge should be performed
type MergeTreeOptions ¶
type MergeTreeOptions struct {
Branch1, Branch2, MergeBase string
type NewOptions ¶
type NewOptions struct {
Remote string
Branch string
TagName string
Commit string
Refname string
Destination string
Depth int
SparseDirs []string
Snapshot bool
SizeLimit int64
Values []string
One bool
Quiet bool
Verbose bool
}
func (*NewOptions) Validate ¶
func (opts *NewOptions) Validate() error
type NewTagOptions ¶
type NopWriteCloser ¶ added in v0.16.0
func (NopWriteCloser) Close ¶ added in v0.16.0
func (NopWriteCloser) Close() error
type OpenOptions ¶
type ProgressBar ¶
type ProgressBar interface {
Add(int)
}
type PullOptions ¶
type PushOptions ¶
type PushOptions struct {
// Refspece: eg:
//
// zeta push dev // update branch or tag
// zeta push :dev // delete branch or tag
// zeta push rev:dev // update reference to rev
// zeta push // update current branch
Refspec string
PushOptions []string
Tag bool
Force bool
}
func (*PushOptions) Target ¶
func (o *PushOptions) Target(name string) plumbing.ReferenceName
type RebaseMD ¶
type RebaseMD struct {
REBASE_HEAD plumbing.Hash `toml:"REBASE_HEAD"` // REBASE_HEAD
ONTO plumbing.Hash `toml:"ONTO"` // ONTO Hash
STOPPED plumbing.Hash `toml:"STOPPED"` // STOPPED Hash
LAST plumbing.Hash `toml:"LAST"` // LAST
MERGE_TREE plumbing.Hash `toml:"MERGE_TREE"` // MERGE_TREE
HEAD plumbing.ReferenceName `toml:"HEAD"` // HEAD aka CURRENT
}
type RebaseOptions ¶
type Reference ¶
type Reference struct {
Name plumbing.ReferenceName `json:"refname"`
ShortName string `json:"refname_short"`
Hash plumbing.Hash `json:"objectname"` // object name : commit/tag object ...
Size int `json:"objectsize"`
Type string `json:"objecttype"`
Target *object.Commit `json:"commit,omitempty"`
Tag *object.Tag `json:"tag,omitempty"`
IsCurrent bool `json:"head,omitempty"`
}
type ReferenceLite ¶
type ReferenceLite struct {
Name plumbing.ReferenceName
ShortName plumbing.ReferenceName
Target plumbing.ReferenceName
}
type References ¶
type References []*Reference
type ReferencesEx ¶
type ReferencesEx struct {
*refs.DB
M map[plumbing.Hash][]*ReferenceLite
}
type RemoteInfo ¶ added in v0.24.0
type RemoteInfo struct {
Remote string `json:"remote"`
}
type RemoveOptions ¶ added in v0.17.0
type RenameOptions ¶ added in v0.20.0
type ReplayMD ¶ added in v0.19.0
type ReplayMD struct {
BASE plumbing.Hash `toml:"BASE"`
LAST plumbing.Hash `toml:"LAST"` // LAST
MERGE_TREE plumbing.Hash `toml:"MERGE_TREE"` // MERGE_TREE
HEAD plumbing.ReferenceName `toml:"HEAD"` // HEAD aka CURRENT --> branch
}
pick or revert -->
type Repository ¶
func Init ¶
func Init(ctx context.Context, opts *InitOptions) (*Repository, error)
func New ¶
func New(ctx context.Context, opts *NewOptions) (*Repository, error)
create a new repo using zeta checkout command
func Open ¶
func Open(ctx context.Context, opts *OpenOptions) (*Repository, error)
func (*Repository) Accelerator ¶
func (r *Repository) Accelerator() config.Accelerator
func (*Repository) BaseDir ¶
func (r *Repository) BaseDir() string
func (*Repository) Cat ¶
func (r *Repository) Cat(ctx context.Context, opts *CatOptions) error
func (*Repository) Close ¶
func (r *Repository) Close() error
func (*Repository) CommitTree ¶
func (r *Repository) CommitTree(ctx context.Context, opts *CommitTreeOptions) (plumbing.Hash, error)
func (*Repository) ConcurrentTransfers ¶
func (r *Repository) ConcurrentTransfers() int
func (*Repository) CreateBranch ¶
func (*Repository) Debug ¶
func (r *Repository) Debug(format string, args ...any)
func (*Repository) DoFetch ¶
func (r *Repository) DoFetch(ctx context.Context, opts *DoFetchOptions) (*FetchResult, error)
DoFetch: Fetch reference or commit
func (*Repository) DoUpdate ¶
func (r *Repository) DoUpdate(ctx context.Context, refname plumbing.ReferenceName, oldRev, newRev plumbing.Hash, committer *object.Signature, message string) error
DoUpdate: update-ref
func (*Repository) FetchObjects ¶
func (*Repository) ForEachReference ¶
func (r *Repository) ForEachReference(ctx context.Context, opts *ForEachReferenceOptions) error
func (*Repository) Grep ¶
func (r *Repository) Grep(ctx context.Context, opts *GrepOptions) ([]GrepResult, error)
Grep performs grep on a repository.
func (*Repository) HashTo ¶
func (r *Repository) HashTo(ctx context.Context, reader io.Reader, size int64) (oid plumbing.Hash, fragments bool, err error)
HashTo computes the (possibly fragmented) hash of an input stream and stores any resulting Fragments object in the object database.
Files below Fragment.Threshold() are stored as a single blob. Larger files are split using either fixed-size or content-defined chunking depending on Fragment.EnableCDC.
func (*Repository) IsAncestor ¶
func (r *Repository) IsAncestor(ctx context.Context, a, b string) error
func (*Repository) IsCurrent ¶
func (r *Repository) IsCurrent(refname plumbing.ReferenceName) bool
func (*Repository) IsExtreme ¶
func (r *Repository) IsExtreme() bool
func (*Repository) ListBranch ¶
func (r *Repository) ListBranch(ctx context.Context, opts *ListBranchOptions) error
func (*Repository) ListTag ¶
func (r *Repository) ListTag(ctx context.Context, opts *ListTagOptions) error
func (*Repository) Log ¶
func (r *Repository) Log(ctx context.Context, opts *LogCommandOptions) error
func (*Repository) LsTree ¶
func (r *Repository) LsTree(ctx context.Context, opts *LsTreeOptions) error
func (*Repository) LsTreeRecurse ¶
func (r *Repository) LsTreeRecurse(ctx context.Context, opts *LsTreeOptions, t *object.Tree, m *Matcher) error
func (*Repository) MergeFile ¶ added in v0.16.0
func (r *Repository) MergeFile(ctx context.Context, opts *MergeFileOptions) error
func (*Repository) MergeTree ¶
func (r *Repository) MergeTree(ctx context.Context, opts *MergeTreeOptions) error
func (*Repository) MoveBranch ¶
func (r *Repository) MoveBranch(from, to string, force bool) error
func (*Repository) NewCommitter ¶
func (r *Repository) NewCommitter() *object.Signature
func (*Repository) NewTag ¶
func (r *Repository) NewTag(ctx context.Context, opts *NewTagOptions) error
func (*Repository) ODB ¶
func (r *Repository) ODB() *odb.ODB
func (*Repository) PickAncestor ¶
func (*Repository) Postflight ¶
func (r *Repository) Postflight(ctx context.Context) error
func (*Repository) Push ¶
func (r *Repository) Push(ctx context.Context, o *PushOptions) error
func (*Repository) RDB ¶
func (r *Repository) RDB() refs.Backend
func (*Repository) ReferenceExists ¶
func (r *Repository) ReferenceExists(ctx context.Context, refname string) error
func (*Repository) ReferenceResolve ¶
func (r *Repository) ReferenceResolve(name plumbing.ReferenceName) (ref *plumbing.Reference, err error)
func (*Repository) ReferencesEx ¶
func (r *Repository) ReferencesEx(ctx context.Context) (*ReferencesEx, error)
func (*Repository) RemoveBranch ¶
func (r *Repository) RemoveBranch(branches []string, force bool) error
func (*Repository) RemoveTag ¶
func (r *Repository) RemoveTag(tags []string) error
func (*Repository) Revision ¶
Revision resolve revision
https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection We are not strictly compatible with Git, do not support combination mode, and do not support finding the second parent
eg: HEAD HEAD^^^^ HEAD~2 BRANCH or TAG Long-OID Short-OID
func (*Repository) RevisionEx ¶
func (r *Repository) RevisionEx(ctx context.Context, revision string) (plumbing.Hash, plumbing.ReferenceName, error)
func (*Repository) Show ¶ added in v0.16.0
func (r *Repository) Show(ctx context.Context, opts *ShowOptions) error
func (*Repository) ShowCurrent ¶
func (r *Repository) ShowCurrent(w io.Writer) error
func (*Repository) ShowRemote ¶ added in v0.24.0
func (r *Repository) ShowRemote(opts *ShowRemoteOptions) error
func (*Repository) SwitchBranch ¶
func (r *Repository) SwitchBranch(ctx context.Context, branch string, so *SwitchOptions) error
func (*Repository) SwitchDetach ¶
func (r *Repository) SwitchDetach(ctx context.Context, basePoint string, so *SwitchOptions) error
func (*Repository) SwitchNewBranch ¶
func (r *Repository) SwitchNewBranch(ctx context.Context, newBranch string, basePoint string, so *SwitchOptions) error
func (*Repository) SwitchOrphan ¶
func (r *Repository) SwitchOrphan(ctx context.Context, newBranch string, so *SwitchOptions) error
func (*Repository) Worktree ¶
func (r *Repository) Worktree() *Worktree
func (*Repository) WriteEncoded ¶
func (*Repository) ZetaDir ¶
func (r *Repository) ZetaDir() string
type ResetMode ¶
type ResetMode int8
ResetMode defines the mode of a reset operation.
const ( // MixedReset resets the index but not the working tree (i.e., the changed // files are preserved but not marked for commit) and reports what has not // been updated. This is the default action. MixedReset ResetMode = iota // HardReset resets the index and working tree. Any changes to tracked files // in the working tree are discarded. HardReset // MergeReset resets the index and updates the files in the working tree // that are different between Commit and HEAD, but keeps those which are // different between the index and working tree (i.e. which have changes // which have not been added). // // If a file that is different between Commit and the index has unstaged // changes, reset is aborted. MergeReset // SoftReset does not touch the index file or the working tree at all (but // resets the head to <commit>, just like all modes do). This leaves all // your changed files "Changes to be committed", as git status would put it. SoftReset )
type ResetOptions ¶
type ResetOptions struct {
// Commit, if commit is present set the current branch head (HEAD) to it.
Commit plumbing.Hash
// Mode, form resets the current branch head to Commit and possibly updates
// the index (resetting it to the tree of Commit) and the working tree
// depending on Mode. If empty MixedReset is used.
Mode ResetMode
// Fetch missing objects
Fetch bool
// One by one checkout files
One bool
Quiet bool
}
ResetOptions describes how a reset operation should be performed.
func (*ResetOptions) Validate ¶
func (o *ResetOptions) Validate(r *Repository) error
Validate validates the fields and sets the default values.
type RestoreOptions ¶
type RevertOptions ¶ added in v0.19.0
type SafeTensorsFile ¶ added in v0.24.0
type SafeTensorsFile struct {
HeaderSize int64 // Size of the 8-byte length prefix + JSON header.
Entries []TensorEntry // Tensor entries sorted by absolute file offset.
}
SafeTensorsFile represents a parsed safetensors file header.
Naming follows the safetensors specification: the per-tensor records in the JSON header are called "entries"; the optional top-level "__metadata__" map is a separate concept and is intentionally not modeled here.
func ParseSafeTensors ¶ added in v0.22.0
func ParseSafeTensors(reader io.Reader, dataSize int64) (*SafeTensorsFile, error)
ParseSafeTensors parses the header of a safetensors stream.
dataSize is the number of payload bytes that follow the header (i.e. fileSize - HeaderSize). Pass -1 if unknown to skip the cross-file bounds check; callers that have a reliable size should always pass it.
The reader is consumed sequentially; no Seek is required.
func (*SafeTensorsFile) Chunks ¶ added in v0.24.0
func (f *SafeTensorsFile) Chunks() []Span
Chunks returns one Span per tensor entry, in offset order.
These spans align chunk boundaries to tensor boundaries, which is the natural unit of change for AI model files.
type ShowOptions ¶ added in v0.16.0
type ShowRemoteOptions ¶ added in v0.24.0
type ShowRemoteOptions struct {
JSON bool
}
type Span ¶ added in v0.24.0
Span is a half-open [Offset, Offset+Size) byte range in a file.
It is the common currency for fragment boundaries across the fixed-size and content-defined chunking paths.
type StashEntry ¶ added in v0.24.0
type StashListOptions ¶ added in v0.24.0
type StashListOptions struct {
JSON bool
}
type StashPushOptions ¶
type StashPushOptions struct {
U bool
}
type Status ¶
type Status map[string]*FileStatus
Status represents the current status of a Worktree. The key of the map is the path of the file.
func (Status) File ¶
func (s Status) File(path string) *FileStatus
File returns the FileStatus for a given path, if the FileStatus doesn't exists a new FileStatus is added to the map using the path as key.
func (Status) IsModified ¶
IsModified checks if file for given path is 'Modified'.
func (Status) IsUntracked ¶
IsUntracked checks if file for given path is 'Untracked'
type StatusCode ¶
type StatusCode byte
StatusCode status code of a file in the Worktree
const ( Unmodified StatusCode = ' ' Untracked StatusCode = '?' Modified StatusCode = 'M' Added StatusCode = 'A' Deleted StatusCode = 'D' Renamed StatusCode = 'R' Copied StatusCode = 'C' UpdatedButUnmerged StatusCode = 'U' )
func (StatusCode) MarshalJSON ¶ added in v0.24.0
func (s StatusCode) MarshalJSON() ([]byte, error)
type StatusJSON ¶ added in v0.24.0
type StatusJSON struct {
Staging []FileStatusJSON `json:"staged,omitempty"`
Unstaging []FileStatusJSON `json:"unstaged,omitempty"`
Untracked []FileStatusJSON `json:"untracked,omitempty"`
}
StatusJSON is the JSON representation of a Status.
type StringArray ¶
type StringArray []string
type SwitchOptions ¶
type SwitchOptions struct {
Force bool // aka discardChanges
Merge bool
ForceCreate bool
Remote bool
Limit int64
// contains filtered or unexported fields
}
func (*SwitchOptions) Validate ¶
func (so *SwitchOptions) Validate() error
type TensorEntry ¶ added in v0.24.0
type TensorEntry struct {
Name string
Dtype string
Shape []int64
Offset int64 // Absolute start offset in the file (header size + data start).
Size int64 // Tensor payload size in bytes.
}
TensorEntry is a single tensor record extracted from the safetensors header, translated into absolute file coordinates.
type UnsetConfigOptions ¶
type UpdateConfigOptions ¶
type Worktree ¶
type Worktree struct {
// External excludes not found in the repository .gitignore/.zetaignore
Excludes []ignore.Pattern
*Repository
// contains filtered or unexported fields
}
Worktree represents a zeta worktree.
func (*Worktree) AddGlob ¶
AddGlob adds all paths, matching pattern, to the index. If pattern matches a directory path, all directory contents are added to the index recursively. No error is returned if all matching paths are already staged in index.
func (*Worktree) AddTracked ¶
func (*Worktree) AddWithOptions ¶
func (w *Worktree) AddWithOptions(ctx context.Context, opts *AddOptions) error
AddWithOptions file contents to the index, updates the index using the current content found in the working tree, to prepare the content staged for the next commit.
It typically adds the current content of existing paths as a whole, but with some options it can also be used to add content with only part of the changes made to the working tree files applied, or remove paths that do not exist in the working tree anymore.
func (*Worktree) Checkout ¶
func (w *Worktree) Checkout(ctx context.Context, opts *CheckoutOptions) error
func (*Worktree) CherryPick ¶ added in v0.19.0
func (w *Worktree) CherryPick(ctx context.Context, opts *CherryPickOptions) error
func (*Worktree) Clean ¶
func (w *Worktree) Clean(ctx context.Context, opts *CleanOptions) error
Clean the worktree by removing untracked files. An empty dir could be removed - this is what `zeta clean -f -d .` does.
func (*Worktree) Commit ¶
Commit stores the current contents of the index in a new commit along with a log message from the user describing the changes.
func (*Worktree) DiffContext ¶
func (w *Worktree) DiffContext(ctx context.Context, opts *DiffOptions) error
func (*Worktree) DiffTreeWithIndex ¶
func (*Worktree) DiffTreeWithWorktree ¶
func (*Worktree) DoCheckIgnore ¶
func (w *Worktree) DoCheckIgnore(ctx context.Context, opts *CheckIgnoreOption) error
func (*Worktree) Grep ¶
func (w *Worktree) Grep(ctx context.Context, opts *GrepOptions) ([]GrepResult, error)
Grep performs grep on a worktree.
func (*Worktree) LsFiles ¶
func (w *Worktree) LsFiles(ctx context.Context, opts *LsFilesOptions) error
func (*Worktree) RemoveGlob ¶
RemoveGlob removes all paths, matching pattern, from the index. If pattern matches a directory path, all directory contents are removed from the index recursively.
func (*Worktree) RemoveLegacy ¶ added in v0.17.0
RemoveLegacy removes files from the working tree and from the index.
func (*Worktree) Rename ¶ added in v0.20.0
func (w *Worktree) Rename(ctx context.Context, source, destination string, opts *RenameOptions) error
zeta rename [-v] [-f] [-n] [-k] <source> <destination>
func (*Worktree) ResetSparsely ¶
func (w *Worktree) ResetSparsely(ctx context.Context, opts *ResetOptions, bar ProgressBar) error
func (*Worktree) Restore ¶
func (w *Worktree) Restore(ctx context.Context, opts *RestoreOptions) error
func (*Worktree) Revert ¶ added in v0.19.0
func (w *Worktree) Revert(ctx context.Context, opts *RevertOptions) error
func (*Worktree) ShowStatusJSON ¶ added in v0.24.0
func (*Worktree) StashApply ¶
func (*Worktree) StashList ¶
func (w *Worktree) StashList(ctx context.Context, opts *StashListOptions) error
func (*Worktree) StashPush ¶
func (w *Worktree) StashPush(ctx context.Context, opts *StashPushOptions) error
type WrapPrinter ¶ added in v0.17.0
type WrapPrinter struct {
io.WriteCloser
}
func (WrapPrinter) ColorMode ¶ added in v0.17.0
func (WrapPrinter) ColorMode() term.Level
func (WrapPrinter) EnableColor ¶ added in v0.17.0
func (WrapPrinter) EnableColor() bool
Source Files
¶
- aria2.go
- blame.go
- branch.go
- cat.go
- cdc.go
- cdc_gear.go
- config.go
- display.go
- dragonfly.go
- editor.go
- fetch.go
- gc.go
- log.go
- lstree.go
- merge_file.go
- merge_tree.go
- misc.go
- objects.go
- options.go
- pager.go
- promisor.go
- push.go
- references.go
- remote.go
- repository.go
- revision.go
- safetensors.go
- show.go
- showdiff.go
- status.go
- switch.go
- tag.go
- transfer.go
- tree.go
- update.go
- worktree.go
- worktree_checkout.go
- worktree_co-extra.go
- worktree_commit.go
- worktree_diff.go
- worktree_linux.go
- worktree_ls_files.go
- worktree_merge.go
- worktree_pull.go
- worktree_rebase.go
- worktree_rename.go
- worktree_replay.go
- worktree_restore.go
- worktree_stash.go
- worktree_status.go
- worktree_tree.go