Documentation ¶
Index ¶
- Constants
- Variables
- func Cleanup()
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Exit(format string, args ...interface{})
- func ExitWithError(err error)
- func FullError(err error)
- func LoggedError(err error, format string, args ...interface{})
- func NewCommand(name string, runFn func(*cobra.Command, []string)) *cobra.Command
- func Panic(err error, format string, args ...interface{})
- func PipeCommand(name string, args ...string) error
- func PipeMediaCommand(name string, args ...string) error
- func Print(format string, args ...interface{})
- func RegisterCommand(name string, runFn func(cmd *cobra.Command, args []string), ...)
- func Run()
- type EntriesBySize
- type JSONStatus
- type JSONStatusEntry
- type MigrateInfoEntry
- type PruneProgress
- type PruneProgressChan
- type PruneProgressType
Constants ¶
const ( PruneProgressTypeLocal = PruneProgressType(iota) PruneProgressTypeRetain = PruneProgressType(iota) PruneProgressTypeVerify = PruneProgressType(iota) )
Variables ¶
var ( Debugging = false ErrorBuffer = &bytes.Buffer{} ErrorWriter = io.MultiWriter(os.Stderr, ErrorBuffer) OutputWriter = io.MultiWriter(os.Stdout, ErrorBuffer) ManPages = make(map[string]string, 20) )
Functions ¶
func Debug ¶
func Debug(format string, args ...interface{})
Debug prints a formatted message if debugging is enabled. The formatted message also shows up in the panic log, if created.
func Error ¶
func Error(format string, args ...interface{})
Error prints a formatted message to Stderr. It also gets printed to the panic log if one is created for this command.
func Exit ¶
func Exit(format string, args ...interface{})
Exit prints a formatted message and exits.
func ExitWithError ¶ added in v1.1.2
func ExitWithError(err error)
ExitWithError either panics with a full stack trace for fatal errors, or simply prints the error message and exits immediately.
func FullError ¶ added in v1.4.0
func FullError(err error)
FullError prints either a full stack trace for fatal errors, or just the error message.
func LoggedError ¶
LoggedError prints the given message formatted with its arguments (if any) to Stderr. If an empty string is passed as the "format" arguemnt, only the standard error logging message will be printed, and the error's body will be omitted.
It also writes a stack trace for the error to a log file without exiting.
func NewCommand ¶ added in v1.4.2
NewCommand creates a new 'git-lfs' sub command, given a command name and command run function.
Each command will initialize the local storage ('.git/lfs') directory when run, unless the PreRun hook is set to nil.
func Panic ¶
Panic prints a formatted message, and writes a stack trace for the error to a log file before exiting.
func PipeCommand ¶
func PipeMediaCommand ¶
func Print ¶
func Print(format string, args ...interface{})
Print prints a formatted message to Stdout. It also gets printed to the panic log if one is created for this command.
func RegisterCommand ¶ added in v1.4.2
func RegisterCommand(name string, runFn func(cmd *cobra.Command, args []string), fn func(cmd *cobra.Command))
RegisterCommand creates a direct 'git-lfs' subcommand, given a command name, a command run function, and an optional callback during the command initialization process.
The 'git-lfs' command initialization is deferred until the `commands.Run()` function is called. The fn callback is passed the output from NewCommand, and gives the caller the flexibility to customize the command by adding flags, tweaking command hooks, etc.
Types ¶
type EntriesBySize ¶
type EntriesBySize []*MigrateInfoEntry
EntriesBySize is an implementation of sort.Interface that sorts a set of `*MigrateInfoEntry`'s
func (EntriesBySize) Len ¶
func (e EntriesBySize) Len() int
Len returns the total length of the set of `*MigrateInfoEntry`'s.
func (EntriesBySize) Less ¶
func (e EntriesBySize) Less(i, j int) bool
Less returns the whether or not the MigrateInfoEntry given at `i` takes up less total size than the MigrateInfoEntry given at `j`.
func (EntriesBySize) Print ¶
func (e EntriesBySize) Print(to io.Writer) (int, error)
Print formats the `*MigrateInfoEntry`'s in the set and prints them to the given io.Writer, "to", returning "n" the number of bytes written, and any error, if one occurred.
func (EntriesBySize) Swap ¶
func (e EntriesBySize) Swap(i, j int)
Swap swaps the entries given at i, j.
type JSONStatus ¶
type JSONStatus struct {
Files map[string]JSONStatusEntry `json:"files"`
}
type JSONStatusEntry ¶
type MigrateInfoEntry ¶
type MigrateInfoEntry struct { // Qualifier is the filepath's extension. Qualifier string // BytesAbove is total size of all files above a given threshold. BytesAbove int64 // TotalAbove is the count of all files above a given size threshold. TotalAbove int64 // BytesTotal is the number of bytes of all files BytesTotal int64 // Total is the count of all files. Total int64 }
MigrateInfoEntry represents a tuple of filetype to bytes and entry count above and below a threshold.
func MapToEntries ¶
func MapToEntries(exts map[string]*MigrateInfoEntry) []*MigrateInfoEntry
MapToEntries creates a set of `*MigrateInfoEntry`'s for a given map of filepath extensions to file size in bytes.
type PruneProgress ¶ added in v1.1.0
type PruneProgress struct { ProgressType PruneProgressType Count int // Number of items done }
Progress from a sub-task of prune
type PruneProgressChan ¶ added in v1.1.0
type PruneProgressChan chan PruneProgress
type PruneProgressType ¶ added in v1.1.0
type PruneProgressType int
Source Files ¶
- command_checkout.go
- command_clean.go
- command_clone.go
- command_env.go
- command_ext.go
- command_fetch.go
- command_filter_process.go
- command_fsck.go
- command_install.go
- command_lock.go
- command_locks.go
- command_logs.go
- command_ls_files.go
- command_migrate.go
- command_migrate_import.go
- command_migrate_info.go
- command_pointer.go
- command_post_checkout.go
- command_post_commit.go
- command_post_merge.go
- command_pre_push.go
- command_prune.go
- command_pull.go
- command_push.go
- command_smudge.go
- command_status.go
- command_track.go
- command_uninstall.go
- command_unlock.go
- command_untrack.go
- command_update.go
- command_version.go
- commands.go
- path.go
- path_nix.go
- pointers.go
- pull.go
- run.go
- uploader.go