Documentation
¶
Index ¶
- Variables
- func FindRepo(start string) (string, error)
- type CLIRepo
- func (r *CLIRepo) BranchDiff(target string) (Diff, error)
- func (r *CLIRepo) CommitDiff(hash string) (Diff, error)
- func (r *CLIRepo) Diff(args []string) (Diff, error)
- func (r *CLIRepo) FileDiff(path string) (Diff, error)
- func (r *CLIRepo) RangeDiff(target, feature string) (Diff, error)
- func (r *CLIRepo) Root() string
- func (r *CLIRepo) StagedDiff() (Diff, error)
- func (r *CLIRepo) UnstagedDiff() (Diff, error)
- type Diff
- type DispatchOptions
- type DispatchRepo
- func (d *DispatchRepo) BranchDiff(target string) (Diff, error)
- func (d *DispatchRepo) CommitDiff(hash string) (Diff, error)
- func (d *DispatchRepo) Diff(args []string) (Diff, error)
- func (d *DispatchRepo) FileDiff(path string) (Diff, error)
- func (d *DispatchRepo) RangeDiff(target, feature string) (Diff, error)
- func (d *DispatchRepo) Root() string
- func (d *DispatchRepo) StagedDiff() (Diff, error)
- func (d *DispatchRepo) UnstagedDiff() (Diff, error)
- type GoGitRepo
- func (g *GoGitRepo) BranchDiff(target string) (Diff, error)
- func (g *GoGitRepo) CommitDiff(hash string) (Diff, error)
- func (g *GoGitRepo) Diff([]string) (Diff, error)
- func (g *GoGitRepo) FileDiff(string) (Diff, error)
- func (g *GoGitRepo) RangeDiff(target, feature string) (Diff, error)
- func (g *GoGitRepo) Root() string
- func (g *GoGitRepo) StagedDiff() (Diff, error)
- func (g *GoGitRepo) UnstagedDiff() (Diff, error)
- type Origin
- type Repo
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type CLIRepo ¶
type CLIRepo struct {
// contains filtered or unexported fields
}
func NewCLIRepo ¶
func (*CLIRepo) Diff ¶ added in v0.9.0
Diff is the generic `git diff <args>` passthrough used by the `commitbrief diff` subcommand. We always inject `--no-color` and `--no-ext-diff` so the parser/renderer pipeline sees the same stable unified-diff shape the other Diff*() helpers produce. The caller is responsible for validating args (e.g. requiring at least one positional ref) — empty args yields `git diff` (i.e. unstaged), which is identical to UnstagedDiff() and discouraged.
func (*CLIRepo) StagedDiff ¶
func (*CLIRepo) UnstagedDiff ¶
type DispatchOptions ¶
type DispatchRepo ¶
type DispatchRepo struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(root string, opts DispatchOptions) (*DispatchRepo, error)
func (*DispatchRepo) BranchDiff ¶
func (d *DispatchRepo) BranchDiff(target string) (Diff, error)
func (*DispatchRepo) CommitDiff ¶
func (d *DispatchRepo) CommitDiff(hash string) (Diff, error)
func (*DispatchRepo) Diff ¶ added in v0.9.0
func (d *DispatchRepo) Diff(args []string) (Diff, error)
func (*DispatchRepo) RangeDiff ¶
func (d *DispatchRepo) RangeDiff(target, feature string) (Diff, error)
func (*DispatchRepo) Root ¶
func (d *DispatchRepo) Root() string
func (*DispatchRepo) StagedDiff ¶
func (d *DispatchRepo) StagedDiff() (Diff, error)
func (*DispatchRepo) UnstagedDiff ¶
func (d *DispatchRepo) UnstagedDiff() (Diff, error)
type GoGitRepo ¶
type GoGitRepo struct {
// contains filtered or unexported fields
}
func NewGoGitRepo ¶
func (*GoGitRepo) Diff ¶ added in v0.9.0
Diff (arbitrary `git diff <args>` passthrough) is intentionally unsupported on the go-git backend — re-implementing every git diff CLI shorthand (HEAD, A..B, A...B, --merge-base, etc.) by hand would balloon the surface area and drift. DispatchRepo falls back to the CLI here.
func (*GoGitRepo) StagedDiff ¶
func (*GoGitRepo) UnstagedDiff ¶
type Repo ¶
type Repo interface {
StagedDiff() (Diff, error)
UnstagedDiff() (Diff, error)
FileDiff(path string) (Diff, error)
CommitDiff(hash string) (Diff, error)
RangeDiff(target, feature string) (Diff, error)
BranchDiff(target string) (Diff, error)
// Diff is the generic `git diff <args>` passthrough used by the
// `commitbrief diff` subcommand. args are forwarded verbatim
// after `--no-color --no-ext-diff` so the renderer/parser see
// stable unified-diff output. Backends that can't faithfully
// implement arbitrary git arg combinations may return
// ErrUnsupported; the DispatchRepo then falls through to the
// CLI path.
Diff(args []string) (Diff, error)
Root() string
}