use

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &charm.Spec{
	Name:  "use",
	Usage: "use [pool][@branch]",
	Short: "use a branch or print current branch and lake",
	Long: `
The use command prints or sets the working pool and branch.  Setting these
values allows commands like load, rebase, merge, etc. to function without
having to specify the working branch.  The branch specifier may also be
a commit ID, in which case you enter a headless state and commands
like load that require a branch will report an error.

The use command is like "git checkout" but there is no local copy of
the lake data.  Rather, the local HEAD state influences commands as
they access the lake.

With no argument, use prints the working pool and branch as well as the
location of the current lake.

With an argument of the form "pool", use sets the working pool as indicated
and the working branch to "main".

With an argument of the form "pool@branch", use sets the working pool and
branch as indicated.

With an argument of the form "@branch", use sets only the working branch.
The working pool must already be set.

The pool must be the name or ID of an existing pool.  The branch must be
the name of an existing branch or a commit ID.

Any command that relies upon HEAD can also be run with the -use option
to refer to a different HEAD without executing an explicit "use" command.
While the use of HEAD is convenient for interactive CLI sessions,
automation and orchestration tools are better off hard-wiring the
HEAD references in each lake command via -use.

The use command merely checks that the branch exists and updates the
file ~/.zed_head.  This file simply contains a pointer to the HEAD branch
and thus provides the default for the -use option.  This way, multiple working
directories can contain different HEAD pointers (along with your local files)
and you can easily switch between windows without having to continually
re-specify a new HEAD.  Unlike Git, all the committed pool data remains
in the lake and is not copied to this local directory.
`,
	New: New,
}

Functions

func New

func New(parent charm.Command, f *flag.FlagSet) (charm.Command, error)

Types

type Command

type Command struct {
	*root.Command
	// contains filtered or unexported fields
}

func (*Command) Run

func (c *Command) Run(args []string) error

Jump to

Keyboard shortcuts

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