{"modulePath":"github.com/DomBlack/git-stack","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitconfig\n\nPackage gitconfig installs and removes the git aliases that make \\`git create\\`, \\`git co\\` and friends run git-stack. Everything goes through \\`git config --global\\`; the file is never edited as text.\n\n## Variables\n\n```go\nvar DefaultAliases = []Alias{\n\t{\"create\", \"stack create\"},\n\t{\"modify\", \"stack modify\"},\n\t{\"absorb\", \"stack absorb\"},\n\t{\"reorder\", \"stack reorder\"},\n\t{\"move\", \"stack move\"},\n\t{\"fold\", \"stack fold\"},\n\t{\"untrack\", \"stack untrack\"},\n\t{\"rename\", \"stack rename\"},\n\t{\"track\", \"stack init\"},\n\t{\"pop\", \"stack pop\"},\n\t{\"restack\", \"stack restack\"},\n\t{\"submit\", \"stack submit\"},\n\t{\"sync\", \"stack sync\"},\n\t{\"up\", \"stack up\"},\n\t{\"down\", \"stack down\"},\n\t{\"top\", \"stack top\"},\n\t{\"bottom\", \"stack bottom\"},\n\t{\"continue\", \"stack continue\"},\n\t{\"abort\", \"stack abort\"},\n\t{\"pr\", \"stack pr\"},\n\t{\"undo\", \"stack undo\"},\n\t{\"get\", \"stack get\"},\n\t{\"c\", \"stack create\"},\n\t{\"m\", \"stack modify\"},\n\t{\"ab\", \"stack absorb\"},\n\t{\"rs\", \"stack restack\"},\n\t{\"ss\", \"stack submit\"},\n\t{\"u\", \"stack up\"},\n\t{\"d\", \"stack down\"},\n\t{\"t\", \"stack top\"},\n\t{\"b\", \"stack bottom\"},\n\t{\"co\", \"stack checkout\"},\n}\n```\nDefaultAliases mirrors Graphite's command names and short forms. \"checkout\" is a git builtin and can never be aliased, hence \"co\".\n\n## Types\n\n```go\ntype Alias struct {\n\tName string\n\t// Command is the part after \"git \", e.g. \"stack submit\".\n\tCommand string\n}\n```\nAlias maps a git alias to a git-stack command.\n\n```go\nfunc (a Alias) Value() string\n```\nValue is the alias value written to git config.\n\n```go\ntype Entry struct {\n\tAlias    Alias\n\tStatus   Status\n\tExisting string\n}\n```\nEntry is one alias with its planned status.\n\n```go\ntype Manager struct {\n\t// contains filtered or unexported fields\n}\n```\nManager plans and applies alias changes.\n\n```go\nfunc New(g *git.Client) *Manager\n```\nNew returns a Manager.\n\n```go\nfunc (m *Manager) Apply(ctx context.Context, p Plan, force bool) (installed, skipped []string, err error)\n```\nApply writes the aliases in the plan. Conflicts are written only when force is set; builtins and shadowing names are always skipped. Every alias written is recorded in stack.managedAliases. It returns the names installed and the names skipped.\n\n```go\nfunc (m *Manager) Checks(*git.Repo) []doctor.Check\n```\nChecks implements doctor.Provider: whether git-stack's git aliases are set. One you set to something else yourself is listed but never counts against you, and the fix never replaces it.\n\n```go\nfunc (m *Manager) Managed(ctx context.Context) ([]string, error)\n```\nManaged returns the aliases recorded as ours.\n\n```go\nfunc (m *Manager) Plan(ctx context.Context, aliases []Alias) (Plan, error)\n```\nPlan checks every alias against builtins, installed commands and existing aliases without changing anything.\n\n```go\nfunc (m *Manager) Uninstall(ctx context.Context) (removed, kept []string, err error)\n```\nUninstall removes every managed alias that still points at git-stack and clears the record. Aliases the user changed since are left alone and reported in kept.\n\n```go\ntype Plan struct {\n\tEntries []Entry\n}\n```\nPlan lists what installing the aliases would do.\n\n```go\ntype Status int\n```\nStatus of one alias in a Plan.\n\n```go\nconst (\n\t// StatusNew: not set yet.\n\tStatusNew Status = iota\n\t// StatusSame: already set to our value.\n\tStatusSame\n\t// StatusConflict: set to a different value.\n\tStatusConflict\n\t// StatusBuiltin: git would ignore it because a builtin has that name.\n\tStatusBuiltin\n\t// StatusShadows: an installed git command has that name.\n\tStatusShadows\n)\n```\n\n```go\nfunc (s Status) String() string\n```\n\n","path":"github.com/DomBlack/git-stack/pkg/gitconfig","name":"gitconfig","synopsis":"Package gitconfig installs and removes the git aliases that make `git create`, `git co` and friends run git-stack.","isRedistributable":true}
