Involved Source Filesbackend.go Package vcs defines the pluggable, VCS-agnostic version control abstraction
used by goship.helpers.goregistry.go
Package-Level Type Names (total 10, all are exported)
/* sort exporteds by: | */
CommitOptions configures a VCS-agnostic commit. Backend-specific options
(such as GPG/SSH signing) live in each backend’s own configuration.Messagestring
func Session.Commit(ctx context.Context, files []string, opts CommitOptions) (string, error)
Exporter is an optional interface that VCS backends may implement to export
the full tracked file tree at rev into destDir in a single operation (for
example via "git archive" or "hg archive") rather than per-file reads.( Exporter) Export(ctx context.Context, rev, destDir string) error
*go.pact.im/x/goship/internal/vcs/fossilvcs.Repo
*go.pact.im/x/goship/internal/vcs/gitvcs.Repo
*go.pact.im/x/goship/internal/vcs/hgvcs.Repo
*go.pact.im/x/goship/internal/vcs/jjvcs.Repo
Registry holds available VCS backend openers without using global mutable state.openers[]Opener Names returns the registered backend names. Open opens the repository at dir using the named backend, or auto-detects
when name is "" or "auto".
func NewRegistry(openers ...Opener) *Registry
func go.pact.im/x/goship/internal/cli.registryFor(vcsCfg config.VCSConfig) *Registry
Session represents an isolated transactional workspace for creating release
commits and tags without directly exposing local filesystem paths to callers. Close releases temporary resources. Calling Close without Publish
leaves the repository unmodified. Commit stages files (repo-relative slash paths) and creates a commit. FS returns a read-only filesystem view of the session’s working tree. Head returns the current revision ID inside this session. ListFiles returns all VCS-tracked files at the session’s current HEAD
under dir ("" or "." for the whole repository). Publish finalizes all commits and tags into the repository. Tag records a tag at the session’s current HEAD. WriteFile writes data to a repo-relative slash path in the session’s
working tree.
*go.pact.im/x/goship/internal/vcs/fossilvcs.session
*go.pact.im/x/goship/internal/vcs/gitvcs.session
*go.pact.im/x/goship/internal/vcs/hgvcs.session
*go.pact.im/x/goship/internal/vcs/jjvcs.session
*go.pact.im/x/goship/internal/vcs/memvcs.session
Session : io.Closer
func VCS.Begin(ctx context.Context, rev Revision) (Session, error)
func go.pact.im/x/goship/internal/vcs/fossilvcs.(*Repo).Begin(ctx context.Context, rev Revision) (Session, error)
func go.pact.im/x/goship/internal/vcs/gitvcs.(*Repo).Begin(ctx context.Context, rev Revision) (Session, error)
func go.pact.im/x/goship/internal/vcs/hgvcs.(*Repo).Begin(ctx context.Context, rev Revision) (Session, error)
func go.pact.im/x/goship/internal/vcs/jjvcs.(*Repo).Begin(ctx context.Context, rev Revision) (Session, error)
func go.pact.im/x/goship/internal/vcs/memvcs.(*Repo).Begin(_ context.Context, rev Revision) (Session, error)
func go.pact.im/x/goship/internal/release.commitLayerUpdates(ctx context.Context, sess Session, layer release.LayerPlan, checksums map[string]modsum.Checksums) (*release.CommitRecord, error)
TagOptions configures a VCS-agnostic tag. Backend-specific options (such as
annotated vs lightweight tags or tag commit messages) live in each backend’s
own configuration.Messagestring
func Session.Tag(ctx context.Context, name string, opts TagOptions) error
VCS provides repository inspection, transactional release sessions, and push
operations for a specific version control system. Begin starts an isolated release transaction rooted at rev. ChangedFiles returns repo-relative slash paths changed between baseRev
and targetRev under dir ("" or "." for the whole repository). ListFiles returns all VCS-tracked files at rev under dir. Name returns the backend identifier (e.g. "git", "hg", "fossil", "jj"). Push pushes the updated ref (if non-empty) and tags to remote. An empty
remote uses the backend’s default remote. PushHint returns a human-readable command hint for publishing res to
remote when -push was not passed. ReadFile returns the contents of a VCS-tracked file at rev. ResolveRev resolves a revision expression. An empty rev resolves the
backend’s current working revision (e.g. HEAD in Git, "." in Mercurial,
"@" in Jujutsu, "current" in Fossil). Root returns the repository root identifier (typically an absolute path). Tags returns all tags currently present in the repository.
*go.pact.im/x/goship/internal/vcs/fossilvcs.Repo
*go.pact.im/x/goship/internal/vcs/gitvcs.Repo
*go.pact.im/x/goship/internal/vcs/hgvcs.Repo
*go.pact.im/x/goship/internal/vcs/jjvcs.Repo
*go.pact.im/x/goship/internal/vcs/memvcs.Repo
func (*Registry).Open(ctx context.Context, name, dir string) (VCS, error)
func go.pact.im/x/goship/internal/vcs/fossilvcs.Open(ctx context.Context, dir string, cfg fossilvcs.Config) (VCS, error)
func go.pact.im/x/goship/internal/vcs/gitvcs.Open(ctx context.Context, dir string, cfg gitvcs.Config) (VCS, error)
func go.pact.im/x/goship/internal/vcs/hgvcs.Open(ctx context.Context, dir string, cfg hgvcs.Config) (VCS, error)
func go.pact.im/x/goship/internal/vcs/jjvcs.Open(ctx context.Context, dir string, cfg jjvcs.Config) (VCS, error)
func go.pact.im/x/goship/internal/apidiff.Compare(ctx context.Context, v VCS, oldRev, newRev, modDir string, workspaceDirs []string) (apidiff.ModuleDiff, error)
func go.pact.im/x/goship/internal/apidiff.CompareBatch(ctx context.Context, v VCS, newRev string, reqs []apidiff.ModuleRequest, workspaceDirs []string) (map[string]apidiff.ModuleDiff, error)
func go.pact.im/x/goship/internal/workspace.(*AutoLoader).Load(ctx context.Context, v VCS, rev string) ([]*modgraph.Module, error)
func go.pact.im/x/goship/internal/workspace.Loader.Load(ctx context.Context, v VCS, rev string) ([]*modgraph.Module, error)
func go.pact.im/x/goship/internal/workspace.(*WalkLoader).Load(ctx context.Context, v VCS, rev string) ([]*modgraph.Module, error)
func go.pact.im/x/goship/internal/workspace.(*WorkLoader).Load(ctx context.Context, v VCS, rev string) ([]*modgraph.Module, error)
func go.pact.im/x/goship/internal/apidiff.loadCommitModules(ctx context.Context, v VCS, rev string, modDirs []string, workspaceDirs []string) (map[string][]*packages.Package, error)
func go.pact.im/x/goship/internal/apidiff.materializeCommit(ctx context.Context, v VCS, rev, tmpRoot string, modDirs, workspaceDirs []string) error
func go.pact.im/x/goship/internal/workspace.loadWorkBytes(ctx context.Context, v VCS, rev, workFile string, data []byte) ([]*modgraph.Module, error)
func go.pact.im/x/goship/internal/workspace.readModule(ctx context.Context, v VCS, rev, modDir string) (*modgraph.Module, error)
func go.pact.im/x/goship/internal/workspace.readModules(ctx context.Context, v VCS, rev string, modDirs []string) ([]*modgraph.Module, error)
Package-Level Functions (total 7, all are exported)
CleanRelDir normalizes a repo-relative directory path, returning "" for the
repository root ("." or "").
CleanRelPath normalizes a repo-relative path to a clean slash-separated form
without a leading "./".
DirPrefix returns a trailing-slash prefix for dir, or "" for the repo root.
ExtractTar extracts regular files from a tar stream into destDir using
os.Root to prevent path traversal. If stripPrefix is non-empty, that leading
slash-terminated prefix is stripped from each entry name. ExtractTar always
drains trailing padding from r so streaming producers do not block on pipes.
NewRegistry creates a Registry with the given VCS backends in priority order.
RunCmd executes an external VCS command in dir with optional stdin and extra
environment variables, returning stdout bytes or a stderr-enriched error.
WriteDirFile safely writes data to slashPath within rootDir using os.Root to
prevent path traversal outside the session working tree.
Package-Level Constants (only one, which is exported)