Documentation
¶
Index ¶
Constants ¶
const ( RefHeadsPrefix = "refs/heads/" RefTagsPrefix = "refs/tags/" )
Branch ref prefixes.
Variables ¶
This section is empty.
Functions ¶
func ExportRevisions ¶
ExportRevisions writes the revisions to dest as git commits on Branch and returns the commit shas written. It creates a fresh repo per run and force-pushes the branch, so it is idempotent for the exported tip. EasyVCS's own object store is never written as git objects — git only exists here in a temporary worktree.
When opts.Squash is true, all revisions are collapsed into a single commit (whose tree is the newest revision's snapshot). When opts.Tags is non-empty, each entry is exported as a lightweight git tag refs/tags/<name> pointing at the commit that exported the revision.
func ImportBranch ¶
ImportBranch pulls a git branch into easyvcs. Each git commit becomes a revision (reusing the `revision:` header id when known, else generating a new one) and returns the local revision ids created, oldest first.
Types ¶
type ImportOptions ¶
type ImportOptions struct {
Source string
Branch string
Token string
// SSHKey, when set, authenticates ssh:// and git@host remotes via a PEM key.
SSHKey string
// SSHKeyPassphrase, if the SSHKey is encrypted.
SSHKeyPassphrase string
}
ImportOptions configures a pull.
type PushOptions ¶
type PushOptions struct {
Dest string
Branch string
Revisions []string
// Tags, if set, are exported as lightweight git tags (refs/tags/<name>)
// pointing at the tip commit of each revision.
Tags []TagRef
Author store.Author
Token string
// SSHKey, when set (a path to a PEM private key), authenticates ssh:// and
// git@host remotes via public key. When empty, an SSH agent is used.
SSHKey string
// SSHKeyPassphrase, if the SSHKey is encrypted.
SSHKeyPassphrase string
// Squash, when true, collapses every revision into a single commit.
Squash bool
}
PushOptions configures an export.