Documentation
¶
Overview ¶
Package gitx runs the system git binary. KanArtist shells out to git rather than embedding a git implementation so it inherits the user's credential helpers, SSH config and performance (PRD §8.1).
Index ¶
- Variables
- func IsNonFastForward(err error) bool
- func ParseTrailers(msg string) map[string]string
- func Toplevel(ctx context.Context, dir string) (string, error)
- func Version(ctx context.Context) (int, int, string, error)
- type Commit
- type Error
- type Repo
- func (r *Repo) Branch(ctx context.Context) string
- func (r *Repo) ChangedPaths(ctx context.Context, from, to string) ([]string, error)
- func (r *Repo) CommitInfo(ctx context.Context, rev string) (*Commit, error)
- func (r *Repo) GitDir(ctx context.Context) (string, error)
- func (r *Repo) Head(ctx context.Context) string
- func (r *Repo) InProgress(ctx context.Context) string
- func (r *Repo) Log(ctx context.Context, revRange string, reverse bool, paths ...string) ([]Commit, error)
- func (r *Repo) OK(ctx context.Context, args ...string) bool
- func (r *Repo) Recent(ctx context.Context, n int, before string, paths ...string) ([]Commit, error)
- func (r *Repo) Run(ctx context.Context, args ...string) (string, error)
- func (r *Repo) RunRaw(ctx context.Context, stdin []byte, args ...string) ([]byte, error)
- func (r *Repo) Status(ctx context.Context, paths ...string) ([]string, error)
- func (r *Repo) Upstream(ctx context.Context) (remote, branch string)
Constants ¶
This section is empty.
Variables ¶
var MinVersion = [2]int{2, 40}
MinVersion is the oldest git ka supports.
Functions ¶
func IsNonFastForward ¶
IsNonFastForward reports whether a push failed because the remote moved.
func ParseTrailers ¶
ParseTrailers reads "Key: value" lines from the last paragraph of a message.
Types ¶
type Commit ¶
type Commit struct {
SHA string
Subject string
Body string
Author string // "Name <email>"
Date string // author date, strict ISO 8601
Trailers map[string]string
}
Commit is one commit with its message trailers.
type Repo ¶
type Repo struct {
Dir string
// Env is appended to the environment of every invocation.
Env []string
}
Repo is a git working tree.
func (*Repo) ChangedPaths ¶
ChangedPaths lists files that differ between two commits.
func (*Repo) CommitInfo ¶
CommitInfo returns one commit's metadata and message.
func (*Repo) InProgress ¶
InProgress reports a rebase, merge or cherry-pick left in the working tree.
func (*Repo) Log ¶
func (r *Repo) Log(ctx context.Context, revRange string, reverse bool, paths ...string) ([]Commit, error)
Log returns commits in rev range (oldest first when reverse is true).
func (*Repo) Recent ¶
Recent returns up to n commits reachable from HEAD, newest first, optionally only those authored before a time (RFC 3339).