Documentation
¶
Overview ¶
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Copyright ©️ Ant Group. All rights reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func ExpireDecoder() kong.MapperFunc
- func NewPrinter(ctx context.Context) *printer
- func SizeDecoder() kong.MapperFunc
- func W(a string) string
- type Az
- type Cat
- type Co
- type ExpireRefs
- type Globals
- type Graft
- type Mc
- type NopWriteCloser
- type Printer
- type PruneRefs
- type Reference
- type Remove
- type ScanRefs
- type Size
- type Smart
- type Snapshot
- type Stat
- type Unbranch
- type VersionFlag
- type WrapPrinter
Constants ¶
const ( Byte int64 = 1 << (iota * 10) KiByte MiByte GiByte TiByte PiByte EiByte )
const (
MAX_SHOW_BINARY_BLOB = 10<<20 - 8
)
Variables ¶
var ( ErrLocalEndpoint = errors.New("local endpoint") ErrWorktreeNotEmpty = errors.New("worktree not empty") )
var (
ErrSyntaxSize = errors.New("size synatx error")
)
Functions ¶
func NewPrinter ¶
func SizeDecoder ¶
func SizeDecoder() kong.MapperFunc
Types ¶
type Az ¶
type Az struct {
Paths []string `arg:"" name:"path" help:"Path to repositories" default:"." type:"path"`
Limit int64 `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB,MB,GB,K,M,G" default:"10m" type:"size"`
FullPath bool `short:"F" name:"full-path" help:"Show full path"`
}
type Cat ¶
type Cat struct {
Object string `arg:"" name:"object" help:"The name of the object to show"`
CWD string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
Type bool `name:"type" short:"t" help:"Show object type"`
Size bool `name:"size" short:"s" help:"Show object size"`
Textconv bool `name:"textconv" help:"Converting text to Unicode"`
JSON bool `name:"json" short:"j" help:"Returns data as JSON; limited to commits, trees, and tags"`
Limit int64 `` /* 143-byte string literal not displayed */
Output string `name:"output" help:"Output to a specific file instead of stdout" placeholder:"<file>"`
}
type Co ¶
type Co struct {
From string `arg:"" name:"from" help:"Original repository remote URL" type:"string"`
Destination string `arg:"" optional:"" name:"destination" help:"Destination for the new repository" type:"path"`
Branch string `` /* 164-byte string literal not displayed */
Commit string `` /* 164-byte string literal not displayed */
Sparse []string `name:"sparse" short:"s" help:"A subset of repository files, all files are checked out by default" type:"string"`
Depth int `name:"depth" short:"d" help:"Create a shallow clone with a history truncated to the specified number of commits" default:"5"`
Limit int64 `` /* 143-byte string literal not displayed */
Recursive bool `` /* 131-byte string literal not displayed */
Values []string `short:"X" shortonly:"" help:"Override default clone/fetch configuration, format: <key>=<value>"`
}
type ExpireRefs ¶
type ExpireRefs struct {
Pattern []string `arg:"" optional:"" name:"pattern" help:"Matching pattern, all references are displayed by default"`
CWD string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
Merged bool `short:"M" name:"merged" help:"Only clean up merged branches, ignoring expiration times"`
Tag bool `short:"T" name:"tag" help:"Clean up expired Tags, off by default"`
Expires time.Duration `short:"E" name:"expires" help:"Reference expiration time, support: m, h, d, w" type:"expire" default:"90d"`
}
func (*ExpireRefs) Match ¶
func (c *ExpireRefs) Match(name string) bool
func (*ExpireRefs) Run ¶
func (c *ExpireRefs) Run(g *Globals) error
type Globals ¶
type Globals struct {
Verbose bool `short:"V" help:"Make the operation more talkative"`
Version VersionFlag `short:"v" name:"version" help:"Show version number and quit"`
}
type Graft ¶
type Graft struct {
Paths []string `arg:"" name:"path" help:"Path to repositories" default:"." type:"path"`
Limit int64 `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB,MB,GB,K,M,G" default:"20m" type:"size"`
Confirm bool `short:"Y" name:"confirm" help:"Confirm rewriting local branches and tags"`
Prune bool `short:"P" name:"prune" help:"Prune repository when commits are rewritten"`
HeadOnly bool `short:"H" name:"head-only" help:"Graft only the default branch"`
FullPath bool `short:"F" name:"full-path" help:"Show full path"`
ALL bool `short:"A" name:"all" help:"Remove all large blobs"`
}
type Mc ¶
type Mc struct {
From string `arg:"" name:"from" help:"Original repository remote URL (or filesystem path)" type:"string"`
Destination string `arg:"" optional:"" name:"destination" help:"Destination where the repository is migrated" type:"path"`
Format string `name:"format" default:"sha256" help:"Specifying the object format, support only: sha1 or sha256"`
Bare bool `short:"b" name:"bare" optional:"" help:"Save as a bare git repository"`
}
type NopWriteCloser ¶
func (NopWriteCloser) Close ¶
func (NopWriteCloser) Close() error
type PruneRefs ¶
type PruneRefs struct {
Prefixes []string `arg:"" optional:"" name:"prefixes" help:"Reference prefixes that need to be cleaned up"` // to targets
CWD string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
Expires time.Duration `short:"e" name:"expires" help:"Reference expiration time, support: m, h, d, w" type:"expire" default:"90d"`
DryRun bool `name:"dry-run" short:"n" help:"Dry run"`
Default bool `short:"D" name:"default" help:"Cleanup references using default prefix"`
Extreme bool `short:"E" name:"extreme" help:"Remove more dirty references"`
}
type Reference ¶
type Remove ¶
type Remove struct {
CWD string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
Paths []string `arg:"" name:"Paths" help:"Path to remove in repository, support wildcards" type:"string"`
Confirm bool `short:"Y" name:"confirm" help:"Confirm rewriting local branches and tags"`
Prune bool `short:"P" name:"prune" help:"Prune repository when commits are rewritten"`
Graft bool `short:"G" name:"graft" help:"Grafting mode"`
HeadOnly bool `short:"H" name:"head-only" help:"Graft only the default branch"`
}
type ScanRefs ¶
type ScanRefs struct {
Pattern []string `arg:"" optional:"" name:"pattern" help:"Matching pattern, all references are displayed by default"`
CWD string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
Oldest bool `short:"O" name:"oldest" help:"Sort by time from oldest to newest"`
}
type Size ¶
type Size struct {
Paths []string `arg:"" name:"path" help:"Path to repositories" default:"." type:"path"`
Limit int64 `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB,MB,GB,K,M,G" default:"20m" type:"size"`
Extract bool `short:"E" name:"extract" optional:"" help:"Whether large files exist in the default branch"`
FullPath bool `short:"F" name:"full-path" help:"Show full path"`
}
type Smart ¶
type Smart struct {
Paths []string `arg:"" name:"path" help:"Path to repositories" default:"." type:"path"`
Limit int64 `short:"L" name:"limit" optional:"" help:"Large file limit size, supported units: KB,MB,GB,K,M,G" default:"20m" type:"size"`
Confirm bool `short:"Y" name:"confirm" help:"Confirm rewriting local branches and tags"`
Prune bool `short:"P" name:"prune" help:"Prune repository when commits are rewritten"`
FullPath bool `short:"F" name:"full-path" help:"Show full path"`
ALL bool `short:"A" name:"all" help:"Remove all large blobs"`
}
type Snapshot ¶
type Snapshot 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"`
Parents []string `name:"parents" short:"p" help:"ID of a parent commit object"`
CWD string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
Orphan bool `name:"orphan" help:"Create an orphan commit"`
Push bool `name:"push" short:"P" help:"Push the worktree snapshot commit to the remote"`
Force bool `name:"force" short:"f" help:"Force updates"`
UnresolvedArgs []string `arg:"" optional:"" hidden:""`
// contains filtered or unexported fields
}
func (*Snapshot) Passthrough ¶
type Stat ¶
type Unbranch ¶
type Unbranch struct {
Revision string `arg:"" optional:"" name:"revision" help:"Linearize the specified revision history"`
CWD string `short:"C" name:"cwd" help:"Specify repository location" default:"." type:"path"`
Confirm bool `short:"Y" name:"confirm" help:"Confirm rewriting local branches and tags"`
Prune bool `short:"P" name:"prune" help:"Prune repository when commits are rewritten"`
Target string `short:"T" name:"target" help:"Save linearized branches to new target"`
Keep int `short:"K" name:"keep" help:"Keep the number of commits, 0 keeps all commits"`
}
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
type WrapPrinter ¶
type WrapPrinter struct {
io.WriteCloser
}
func (WrapPrinter) ColorMode ¶
func (WrapPrinter) ColorMode() term.Level
func (WrapPrinter) EnableColor ¶
func (WrapPrinter) EnableColor() bool