Documentation ¶
Index ¶
- Constants
- Variables
- func ExpiryDateDecoder() kong.MapperFunc
- func SizeDecoder() kong.MapperFunc
- type Add
- type Branch
- type Cat
- type CheckIgnore
- type Checkout
- type Clean
- type Commit
- type Config
- type Debuger
- type Diff
- type Fetch
- type ForEachRef
- type GC
- type Globals
- type HashObject
- type Init
- type Log
- type LsFiles
- type LsTree
- type Merge
- type MergeBase
- type MergeTree
- type Pull
- type Push
- type Rebase
- type Remote
- type Remove
- type Reset
- type Restore
- type RevParse
- type SetRemote
- type ShowRemote
- type Stash
- type StashApply
- type StashClear
- type StashDrop
- type StashList
- type StashPop
- type StashPush
- type StashShow
- type Status
- type Switch
- type Tag
- type Version
- type VersionFlag
Constants ¶
View Source
const ( Byte int64 = 1 << (iota * 10) KiByte MiByte GiByte TiByte PiByte EiByte )
Variables ¶
View Source
var ( ErrSyntaxSize = errors.New("size synatx error") ErrFlagsIncompatible = errors.New("flags incompatible") )
View Source
var (
ErrArgRequired = errors.New("arg required")
)
View Source
var (
W = tr.W // translate func wrap
)
Functions ¶
func SizeDecoder ¶
func SizeDecoder() kong.MapperFunc
Types ¶
type Add ¶
type Add struct { ALL bool `name:"all" short:"A" help:"Add changes from all tracked and untracked files"` DryRun bool `name:"dry-run" short:"n" help:"Dry run"` Update bool `name:"update" short:"u" help:"Update tracked files"` Chmod string `name:"chmod" help:"Override the executable bit of the listed files" placeholder:"(+|-)x"` PathSpec []string `arg:"" optional:"" name:"pathspec" help:"Path specification, similar to Git path matching mode"` }
Add file contents to the index
type Branch ¶
type Branch struct { ShowCurrent bool `name:"show-current" help:"Show current branch name"` List bool `name:"list" short:"l" help:"List branches. With optional <pattern>..."` Copy bool `name:"copy" short:"c" help:"Copy a branch and its reflog"` ForceCopy bool `name:":force-copy" short:"C" help:"Copy a branch, even if target exists"` Delete bool `name:"delete" short:"d" help:"Delete fully merged branch"` ForceDelete bool `name:":force-delete" short:"D" help:"Delete branch (even if not merged)"` Move bool `name:"move" short:"m" help:"Move/rename a branch and its reflog"` ForceMove bool `name:":force-move" short:"M" help:"Move/rename a branch, even if target exists"` Force bool `name:"force" short:"f" help:"Force creation, move/rename, deletion"` Args []string `arg:"" optional:"" name:"args" help:"Branch args: <branchname>, <pattern>, <start-point>"` }
func (*Branch) IsForceCopy ¶
func (*Branch) IsForceDelete ¶
func (*Branch) IsForceMove ¶
type Cat ¶
type Cat struct { Hash string `arg:"" name:"object" help:"The name of the object to show"` WriteMax int64 `` /* 137-byte string literal not displayed */ T bool `name:"type" short:"t" help:"Show object type"` DisplaySize bool `name:":" short:"s" help:"Show object size"` JSON bool `name:"json" short:"j" help:"Returns data as JSON; limited to commits, trees, fragments, and tags"` Textconv bool `name:"textconv" help:"Output text as Unicode; blobs only"` Verify bool `name:"verify" help:"Verify object hash"` }
type CheckIgnore ¶
type CheckIgnore struct { Stdin bool `name:"stdin" help:"Read file names from stdin"` Z bool `name:":z" short:"z" help:"Terminate input and output records by a NUL character"` JSON bool `name:"json" short:"j" help:"Data will be returned in JSON format"` Paths []string `arg:"" name:"pathname" optional:"" help:"Pathname given via the command-line"` }
func (*CheckIgnore) Run ¶
func (c *CheckIgnore) Run(g *Globals) error
func (*CheckIgnore) Summary ¶
func (c *CheckIgnore) Summary() string
type Checkout ¶
type Checkout struct { UnresolvedArgs []string `arg:"" optional:"" hidden:""` Branch string `name:"branch" short:"b" help:"Direct the new HEAD to the <name> branch after checkout"` TagName string `name:"tag" short:"t" help:"Direct the new HEAD to the <name> tag's commit after checkout"` Commit string `name:"commit" help:"Direct the new HEAD to the <commit> branch after checkout"` Sparse []string `name:"sparse" short:"s" help:"A subset of repository files, all files are checked out by default" type:"string"` Limit int64 `` /* 143-byte string literal not displayed */ Batch bool `name:"batch" help:"Get and checkout files for each provided on stdin"` Snapshot bool `name:"snapshot" help:"Checkout a non-editable snapshot"` Depth int `name:"depth" help:"Create a shallow clone with a history truncated to the specified number of commits" default:"1"` One bool `name:"one" help:"Checkout large files one after another"` Quiet bool `name:"quiet" help:"Operate quietly. Progress is not reported to the standard error stream"` // contains filtered or unexported fields }
func (*Checkout) Passthrough ¶
type Clean ¶
type Commit ¶
type Commit struct { Message []string `name:"message" short:"m" help:"Use the given as the commit message. Concatenate multiple -m options as separate paragraphs"` File string `name:"file" short:"F" help:"Take the commit message from the given file. Use - to read the message from the standard input"` All bool `name:"all" short:"a" help:"Automatically stage modified and deleted files, but newly untracked files remain unaffected"` AllowEmpty bool `name:"allow-empty" help:"Allow creating a commit with the exact same tree structure as its parent commit"` AllowEmptyMessage bool `name:"allow-empty-message" help:"Like --allow-empty this command is primarily for use by foreign SCM interface scripts"` Amend bool `name:"amend" help:"Replace the tip of the current branch by creating a new commit"` }
type Config ¶
type Config struct { Args []string `` /* 141-byte string literal not displayed */ System bool `name:"system" help:"Use system config file"` Global bool `name:"global" help:"Only read or write to global ~/.zeta.toml"` Local bool `name:"local" help:"Only read or write to repository .zeta/zeta.toml, which is the default behavior when writing"` Unset bool `name:"unset" short:"u" help:"Remove the line matching the key from config file"` List bool `name:"list" short:"l" help:"List all variables set in config file, along with their values"` Get bool `name:"get" help:"Get the value for a given Key"` GetALL bool `name:"get-all" help:"Get all values for a given Key"` Add bool `name:"add" help:"Add a new variable: name value"` Z bool `name:":z" short:"z" help:"Terminate values with NUL byte"` Type string `` /* 154-byte string literal not displayed */ }
type Diff ¶
type Diff struct { NameOnly bool `name:"name-only" help:"Show only names of changed files"` NameStatus bool `name:"name-status" help:"Show names and status of changed files"` Numstat bool `name:"numstat" help:"Show numeric diffstat instead of patch"` Stat bool `name:"stat" help:"Show diffstat instead of patch"` ShortStat bool `name:"shortstat" help:"Output only the last line of --stat format"` Z bool `name:":z" short:"z" help:"Output diff-raw with lines terminated with NUL"` Staged bool `name:"staged" help:"Compare the differences between the staging area and <revision>"` Cached bool `name:"cached" help:"Compare the differences between the staging area and <revision>"` Textconv bool `name:"textconv" help:"Convert text to Unicode and compare differences"` MergeBase string `name:"merge-base" help:"If --merge-base is given, use the common ancestor of <commit> and HEAD instead"` Output string `name:"output" help:"Output to a specific file instead of stdout" placeholder:"<file>"` Histogram bool `name:"histogram" help:"Generate a diff using the \"Histogram diff\" algorithm"` ONP bool `name:"onp" help:"Generate a diff using the \"O(NP) diff\" algorithm"` Myers bool `name:"myers" help:"Generate a diff using the \"Myers diff\" algorithm"` Patience bool `name:"patience" help:"Generate a diff using the \"Patience diff\" algorithm"` Minimal bool `name:"minimal" help:"Spend extra time to make sure the smallest possible diff is produced"` DiffAlgorithm string `name:"diff-algorithm" help:"Choose a diff algorithm, supported: histogram|onp|myers|patience|minimal"` From string `arg:"" optional:"" name:"from" help:"Revision from"` To string `arg:"" optional:"" name:"to" help:"Revision to"` // contains filtered or unexported fields }
func (*Diff) NewOptions ¶
func (c *Diff) NewOptions() (*zeta.DiffOptions, error)
func (*Diff) Passthrough ¶
type Fetch ¶
type Fetch struct { Name string `arg:"" optional:"" name:"name" help:"Reference or commit to be downloaded"` Unshallow bool `name:"unshallow" help:"Get complete history"` Tag bool `name:"tag" short:"t" help:"Download tags instead of branches only when refname is incomplete"` // Limit int64 `` /* 143-byte string literal not displayed */ Force bool `name:"force" short:"f" help:"Override reference update check"` }
In the design of HugeSCM, we have abandoned the philosophy of git where the retrieval of repository data should be minimalistic, that is, to fetch only what is needed. Therefore, when implementing the fetch feature, it's important to adhere to the principle that zeta fetch will not support fetching all data at once, but will only support fetching specific reference metadata and particular objects.
type ForEachRef ¶
type ForEachRef struct { JSON bool `name:"json" short:"j" help:"Data will be returned in JSON format"` Sort string `name:"sort" help:"Field name to sort on"` Pattern []string `arg:"" optional:"" name:"pattern" help:"If given, only refs matching at least one pattern are shown"` }
func (*ForEachRef) Run ¶
func (c *ForEachRef) Run(g *Globals) error
type GC ¶
type Globals ¶
type Globals struct { Verbose bool `short:"V" name:"verbose" help:"Make the operation more talkative"` Version VersionFlag `short:"v" name:"version" help:"Show version number and quit"` Values []string `short:"X" name:":config" help:"Override default configuration, format: <key>=<value>"` CWD string `name:"cwd" help:"Set the path to the repository worktree"` }
type HashObject ¶
type HashObject struct { W bool `name:":w" short:"w" help:"Write the object into the object database"` Stdin bool `name:"stdin" help:"Read the object from stdin"` Path string `name:"path" help:"Process file as it were from this path"` }
func (*HashObject) Run ¶
func (c *HashObject) Run(g *Globals) error
type Init ¶
type Log ¶
type Log struct { RevisionRange string `arg:"" optional:"" name:"revision-range" help:"Revision range"` JSON bool `name:"json" short:"j" help:"Data will be returned in JSON format"` // contains filtered or unexported fields }
func (*Log) Passthrough ¶
type LsFiles ¶
type LsFiles struct { Cached bool `name:"cached" short:"c" help:"Show cached files in the output (default)"` Deleted bool `name:"deleted" short:"d" help:"Show deleted files in the output"` Modified bool `name:"modified" short:"m" help:"Show modified files in the output"` Others bool `name:"others" short:"o" help:"Show other files in the output"` Stage bool `name:"stage" short:"s" help:"Show staged contents' object name in the output"` Z bool `name:":z" short:"z" help:"Terminate entries with NUL byte"` JSON bool `name:"json" short:"j" help:"Data will be returned in JSON format"` Paths []string `arg:"" name:"path" optional:"" help:"Given paths, show as match patterns; else, use root as sole argument"` }
type LsTree ¶
type LsTree struct { OnlyTrees bool `name:":only-trees" short:"d" help:"Only show trees"` Recurse bool `name:":recurse" short:"r" help:"Recurse into subtrees"` Tree bool `name:":tree" short:"t" help:"Show trees when recursing"` Z bool `name:":z" short:"z" help:"Terminate entries with NUL byte"` Long bool `name:"long" short:"l" help:"Include object size"` NameOnly bool `name:"name-only" alias:"name-status" help:"List only filenames"` Abbrev int `name:"abbrev" help:"Use <n> digits to display object names"` JSON bool `name:"json" short:"j" help:"Data will be returned in JSON format"` Revision string `arg:"" name:"tree-ish" help:"ID of a tree-ish"` Paths []string `arg:"" name:"path" optional:"" help:"Given paths, show as match patterns; else, use root as sole argument"` }
type Merge ¶
type Merge struct { Revision string `arg:"" optional:"" name:"revision" help:"Merge specific revision into HEAD"` FF bool `name:"ff" negatable:"" help:"Allow fast-forward" default:"true"` FFOnly bool `name:"ff-only" help:"Abort if fast-forward is not possible"` Squash bool `name:"squash" help:"Create a single commit instead of doing a merge"` Textconv bool `name:"textconv" help:"Convert text to Unicode before merging"` Message []string `name:"message" short:"m" help:"Merge commit message (for a non-fast-forward merge)"` File string `name:"file" short:"F" help:"Read message from file"` Signoff bool `name:"signoff" negatable:"" help:"Add a Signed-off-by trailer" default:"false"` Abort bool `name:"abort" help:"Abort a conflicting merge"` Continue bool `name:"continue" help:"Continue a merge with resolved conflicts"` }
Join two or more development histories together
type MergeBase ¶
type MergeTree ¶
type MergeTree struct { Branch1 string `arg:"" name:"branch1" help:"branch1"` Branch2 string `arg:"" name:"branch2" help:"branch2"` MergeBase string `name:"merge-base" help:"Specify a merge-base for the merge"` NameOnly bool `name:"name-only" help:"Only output conflict-related file names"` Textconv bool `name:"textconv" help:"Convert text to Unicode before merging"` Z bool `name:":z" short:"z" help:"Terminate entries with NUL byte"` JSON bool `name:"json" help:"Convert conflict results to JSON"` }
type Pull ¶
type Pull struct { FF bool `name:"ff" negatable:"" help:"Allow fast-forward" default:"true"` FFOnly bool `name:"ff-only" help:"Abort if fast-forward is not possible"` Rebase bool `name:"rebase" help:"Incorporate changes by rebasing rather than merging"` Squash bool `name:"squash" help:"Create a single commit instead of doing a merge"` Unshallow bool `name:"unshallow" help:"Get complete history"` One bool `name:"one" help:"Checkout large files one after another"` Limit int64 `` /* 143-byte string literal not displayed */ }
type Push ¶
type Push struct { Refspec string `arg:"" optional:"" name:"refspec" default:"" help:"Specify what destination ref to update with what source object"` PushOptions []string `name:"push-option" short:"o" help:"Option to transmit"` Tag bool `name:"tag" short:"t" help:"Update remote tag reference"` Force bool `name:"force" short:"f" help:"force updates"` }
type Rebase ¶
type Remote ¶
type Remote struct { Show ShowRemote `cmd:"show" help:"Gives some information about the remote" default:"1"` Set SetRemote `cmd:"set" help:"Set URL for the remote"` }
type Remove ¶
type Remove struct { DryRun bool `name:"dry-run" short:"n" help:"Dry run"` Quiet bool `name:"quiet" short:"q" help:"Do not list removed files"` Cached bool `name:"cached" help:"Only remove from the index"` Force bool `name:"force" short:"f" help:"Override the up-to-date check"` Recurse bool `name:":recurse" short:"r" help:"Allow recursive removal"` PathSpec []string `arg:"" optional:"" name:"pathspec" help:"Path specification, similar to Git path matching mode"` }
type Reset ¶
type Reset struct { Revision string `arg:"" optional:"" name:"commit" help:"Resets the current branch head to <commit>"` Mixed bool `name:"mixed" help:"Reset HEAD and index"` Soft bool `name:"soft" help:"Reset only HEAD"` Hard bool `name:"hard" help:"Reset HEAD, index and working tree, changes discarded"` Merge bool `name:"merge" help:"Reset HEAD, index and working tree"` Keep bool `name:"keep" help:"Reset HEAD but keep local changes"` Fetch bool `name:"fetch" help:"Fetch missing objects"` One bool `name:"one" help:"Checkout large files one after another, --hard mode only"` Limit int64 `` /* 143-byte string literal not displayed */ Quiet bool `name:"quiet" help:"Operate quietly. Progress is not reported to the standard error stream"` // contains filtered or unexported fields }
Reset current HEAD to the specified state
func (*Reset) Passthrough ¶
type Restore ¶
type Restore struct { Source string `name:"source" short:"s" help:"Which tree-ish to checkout from"` Staged bool `name:"staged" short:"S" negatable:"" help:"Restore the index"` Worktree bool `name:"worktree" short:"W" negatable:"" help:"Restore the working tree (default)"` Paths []string `arg:"" optional:"" name:"pathspec" help:"Limits the paths affected by the operation"` }
type RevParse ¶
type SetRemote ¶
type SetRemote struct {
URL string `arg:"" name:"url" help:"URL for the remote"`
}
Set or replace remote
type ShowRemote ¶
type ShowRemote struct {
JSON bool `name:"json" short:"j" help:"Data will be returned in JSON format"`
}
func (*ShowRemote) Run ¶
func (c *ShowRemote) Run(g *Globals) error
type Stash ¶
type Stash struct { Push StashPush `cmd:"push" help:"Stash local changes and revert to HEAD" default:"1"` List StashList `cmd:"list" help:"List the stash entries that you currently have"` Show StashShow `cmd:"show" help:"Displays the diff of changes in a stash entry against the commit where it was created"` Clear StashClear `cmd:"clear" help:"Remove all the stash entries"` Drop StashDrop `cmd:"drop" help:"Remove a single stash entry from the list of stash entries"` Pop StashPop `cmd:"pop" help:"Apply and remove one stash"` Apply StashApply `cmd:"apply" help:"Like pop, but do not remove the state from the stash list"` }
type StashApply ¶
type StashApply struct {
Stash string `arg:"" optional:"" name:"stash" help:"Stash index" default:"stash@{0}"`
}
func (*StashApply) Run ¶
func (c *StashApply) Run(g *Globals) error
type StashClear ¶
type StashClear struct { }
func (*StashClear) Run ¶
func (c *StashClear) Run(g *Globals) error
type StashDrop ¶
type StashDrop struct {
Stash string `arg:"" optional:"" name:"stash" help:"Stash index" default:"stash@{0}"`
}
type StashPop ¶
type StashPop struct { Index bool `name:"index" negatable:"" help:"Attempt to recreate the index"` Stash string `arg:"" optional:"" name:"stash" help:"Stash index" default:"stash@{0}"` }
stash@{1}
type StashPush ¶
type StashPush struct {
U bool `name:"include-untracked" short:"u" help:"Stashed untracked files with push/save, then cleaned with zeta clean"`
}
type StashShow ¶
type Status ¶
type Switch ¶
type Switch struct { Args []string `arg:"" optional:"" help:"Branch to switch to and start-point"` Create bool `name:"create" short:"c" help:"Create a new branch named <branch> starting at <start-point> before switching to the branch"` ForceCreate bool `` /* 130-byte string literal not displayed */ Detach bool `name:"detach" help:"Switch to a commit for inspection and discardable experiments"` Orphan bool `name:"orphan" help:"Create a new orphan branch, named <new-branch>. All tracked files are removed"` DiscardChanges bool `name:"discard-changes" help:"Proceed even if the index or the working tree differs from HEAD"` Force bool `name:"force" short:"f" help:"An alias for --discard-changes"` Merge bool `name:"merge" short:"m" negatable:"" default:"true" help:"Perform a 3-way merge with the new branch"` Remote bool `name:"remote" help:"Attempt to checkout from remote when branch is absent"` Limit int64 `` /* 143-byte string literal not displayed */ Quiet bool `name:"quiet" help:"Operate quietly. Progress is not reported to the standard error stream"` }
type Tag ¶
type Tag struct { Annotate bool `name:"annotate" short:"a" help:"Annotated tag, needs a message"` File string `name:"file" short:"F" help:"Take the tag message from the given file. Use - to read the message from the standard input"` Message []string `name:"message" short:"m" help:"Use the given tag message (instead of prompting)"` List bool `name:"list" short:"l" help:"List tags. With optional <pattern>..."` Delete bool `name:"delete" short:"d" help:"Delete tags"` Force bool `name:"force" short:"f" help:"Replace the tag if exists"` Args []string `arg:"" optional:"" name:"args" help:"Tag args: <tagname>, <pattern>, <start-point>"` }
type Version ¶
type VersionFlag ¶
type VersionFlag bool
func (VersionFlag) BeforeApply ¶
func (VersionFlag) Decode ¶
func (v VersionFlag) Decode(ctx *kong.DecodeContext) error
func (VersionFlag) IsBool ¶
func (v VersionFlag) IsBool() bool
Source Files ¶
- command.go
- command_add.go
- command_branch.go
- command_cat.go
- command_check_ignore.go
- command_checkout.go
- command_clean.go
- command_commit.go
- command_config.go
- command_diff.go
- command_fetch.go
- command_for_each_ref.go
- command_gc.go
- command_hash_object.go
- command_init.go
- command_log.go
- command_ls_files.go
- command_ls_tree.go
- command_merge.go
- command_merge_base.go
- command_merge_tree.go
- command_pull.go
- command_push.go
- command_rebase.go
- command_remote.go
- command_reset.go
- command_restore.go
- command_rev_parse.go
- command_rm.go
- command_stash.go
- command_status.go
- command_switch.go
- command_tag.go
- command_version.go
- msic.go
Click to show internal directories.
Click to hide internal directories.