Documentation
¶
Overview ¶
Package git implements the `atmos git` command group, providing Git repository operations (clone, pull, status, diff, commit, push) through the shared pkg/git service and provider registry.
All commands follow the command registry pattern (CommandProvider interface) and use flags.NewStandardParser() for flag handling.
Index ¶
- func IsURI(s string) bool
- func SetAtmosConfig(config *schema.AtmosConfiguration)
- type Executor
- func (e *Executor) Clone(ctx context.Context, opts *atmosgit.CloneOptions, label string) error
- func (e *Executor) CloneWithoutSpinner(ctx context.Context, opts *atmosgit.CloneOptions, label string) error
- func (e *Executor) Commit(ctx context.Context, opts *atmosgit.CommitOptions) (*atmosgit.CommitResult, error)
- func (e *Executor) Diff(ctx context.Context, opts *atmosgit.DiffOptions) (*atmosgit.DiffResult, error)
- func (e *Executor) Init(ctx context.Context, opts *atmosgit.InitOptions, label string) error
- func (e *Executor) Pull(ctx context.Context, opts *atmosgit.PullOptions) error
- func (e *Executor) Push(ctx context.Context, opts *atmosgit.PushOptions) error
- func (e *Executor) Status(ctx context.Context, opts *atmosgit.StatusOptions) (*atmosgit.StatusResult, error)
- type GitCommandProvider
- func (g *GitCommandProvider) GetAliases() []internal.CommandAlias
- func (g *GitCommandProvider) GetCommand() *cobra.Command
- func (g *GitCommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
- func (g *GitCommandProvider) GetFlagsBuilder() flags.Builder
- func (g *GitCommandProvider) GetGroup() string
- func (g *GitCommandProvider) GetName() string
- func (g *GitCommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
- func (g *GitCommandProvider) IsExperimental() bool
- type GitListOptions
- type ParsedURI
- type StatusProber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsURI ¶
IsURI reports whether s looks like a Git URI:
- has git:: forcing prefix
- starts with https:// or http://
- starts with git@... (SCP-style)
- starts with ssh://
- starts with git://
func SetAtmosConfig ¶
func SetAtmosConfig(config *schema.AtmosConfiguration)
SetAtmosConfig is called from root.go after atmosConfig is initialized, making the configuration available to all git subcommands.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor holds the resolved inputs for a single Git operation and delegates to an injected Provider. This enables unit testing without invoking real git subprocesses: tests pass a stub provider; production passes the real one.
func (*Executor) CloneWithoutSpinner ¶
func (*Executor) Commit ¶
func (e *Executor) Commit(ctx context.Context, opts *atmosgit.CommitOptions) (*atmosgit.CommitResult, error)
Commit delegates to the provider.
func (*Executor) Diff ¶
func (e *Executor) Diff(ctx context.Context, opts *atmosgit.DiffOptions) (*atmosgit.DiffResult, error)
Diff delegates to the provider.
func (*Executor) Status ¶
func (e *Executor) Status(ctx context.Context, opts *atmosgit.StatusOptions) (*atmosgit.StatusResult, error)
Status delegates to the provider and prints the result.
type GitCommandProvider ¶
type GitCommandProvider struct{}
GitCommandProvider implements the CommandProvider interface for `atmos git`.
func (*GitCommandProvider) GetAliases ¶
func (g *GitCommandProvider) GetAliases() []internal.CommandAlias
GetAliases returns command aliases for git subcommands. Registers "atmos list git-repositories" as an alias for "atmos git list", following the same pattern as "atmos workflow list" ↔ "atmos list workflows".
func (*GitCommandProvider) GetCommand ¶
func (g *GitCommandProvider) GetCommand() *cobra.Command
GetCommand returns the git parent command (with all subcommands attached).
func (*GitCommandProvider) GetCompatibilityFlags ¶
func (g *GitCommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag
GetCompatibilityFlags returns compatibility flags for this command. The git command group has no compatibility flags.
func (*GitCommandProvider) GetFlagsBuilder ¶
func (g *GitCommandProvider) GetFlagsBuilder() flags.Builder
GetFlagsBuilder returns the flags builder for this command. The parent git command has no flags of its own.
func (*GitCommandProvider) GetGroup ¶
func (g *GitCommandProvider) GetGroup() string
GetGroup returns the command group for help organization.
func (*GitCommandProvider) GetName ¶
func (g *GitCommandProvider) GetName() string
GetName returns the command name.
func (*GitCommandProvider) GetPositionalArgsBuilder ¶
func (g *GitCommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder
GetPositionalArgsBuilder returns the positional args builder for this command. The parent git command has no positional arguments.
func (*GitCommandProvider) IsExperimental ¶
func (g *GitCommandProvider) IsExperimental() bool
IsExperimental returns whether this command is experimental.
type GitListOptions ¶
type GitListOptions struct {
global.Flags
Columns []string
Format string
Delimiter string
CheckStatus bool
}
GitListOptions holds parsed options for `atmos git list`.
type ParsedURI ¶
type ParsedURI struct {
// URI is the clean remote URI (without git:: prefix and without query params).
URI string
// Branch is the parsed branch/ref from ?ref=, or empty.
Branch string
// Depth is the parsed clone depth from ?depth=, or 0 for full history.
Depth int
// RepoName is the last path component without .git suffix, used as the
// clone directory name for ad hoc URI clones.
RepoName string
}
ParsedURI is the result of parsing a clone URI argument.
func ParseCloneURI ¶
ParseCloneURI parses a clone URI argument, stripping the git:: prefix and extracting ?ref= and ?depth= query parameters (precedence: flags > query params > config). Unknown query parameters return an error.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package hooks implements the `atmos git hooks` command group: thin cobra wiring over pkg/git/hooks, which owns the shim install/run/uninstall logic.
|
Package hooks implements the `atmos git hooks` command group: thin cobra wiring over pkg/git/hooks, which owns the shim install/run/uninstall logic. |