Documentation
¶
Overview ¶
* Handles invoking Git as a subprocess.
Index ¶
- type LogFilters
- type Subprocess
- func RunConfigGet(ctx context.Context, args []string) (*Subprocess, error)
- func RunLog(ctx context.Context, revs []string, pathspecs []string, filters LogFilters, ...) (*Subprocess, error)
- func RunLsFiles(ctx context.Context, pathspecs []string) (*Subprocess, error)
- func RunRevList(ctx context.Context, revs []string, pathspecs []string, filters LogFilters) (*Subprocess, error)
- func RunRevParse(ctx context.Context, args []string) (*Subprocess, error)
- func RunRevParseTopLevel(ctx context.Context) (*Subprocess, error)
- func RunStdinLog(ctx context.Context, pathspecs []string, needDiffs bool, useMailmap bool) (*Subprocess, error)
- func (s Subprocess) StdinWriter() (_ *bufio.Writer, closer func() error)
- func (s Subprocess) StdoutLines() (iter.Seq[string], func() error)
- func (s Subprocess) StdoutNullDelimitedLines() (iter.Seq[string], func() error)
- func (s Subprocess) StdoutText() (string, error)
- func (s Subprocess) Wait() error
- type SubprocessErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogFilters ¶
func (LogFilters) ToArgs ¶
func (f LogFilters) ToArgs() []string
Turn into CLI args we can pass to `git log`
type Subprocess ¶
type Subprocess struct {
// contains filtered or unexported fields
}
func RunConfigGet ¶
func RunConfigGet(ctx context.Context, args []string) (*Subprocess, error)
func RunLog ¶
func RunLog( ctx context.Context, revs []string, pathspecs []string, filters LogFilters, needDiffs bool, useMailmap bool, ) (*Subprocess, error)
Runs git log
func RunLsFiles ¶
func RunLsFiles(ctx context.Context, pathspecs []string) (*Subprocess, error)
func RunRevList ¶
func RunRevList( ctx context.Context, revs []string, pathspecs []string, filters LogFilters, ) (*Subprocess, error)
Runs git rev-list. When countOnly is true, passes --count, which is much faster than printing then getting all the revisions when all you need is the count.
func RunRevParse ¶
func RunRevParse(ctx context.Context, args []string) (*Subprocess, error)
Runs git rev-parse
func RunRevParseTopLevel ¶
func RunRevParseTopLevel(ctx context.Context) (*Subprocess, error)
func RunStdinLog ¶
func RunStdinLog( ctx context.Context, pathspecs []string, needDiffs bool, useMailmap bool, ) (*Subprocess, error)
Runs git log --stdin
func (Subprocess) StdinWriter ¶
func (s Subprocess) StdinWriter() (_ *bufio.Writer, closer func() error)
func (Subprocess) StdoutLines ¶
func (s Subprocess) StdoutLines() (iter.Seq[string], func() error)
Returns a single-use iterator over the output of the command, line by line.
func (Subprocess) StdoutNullDelimitedLines ¶
func (s Subprocess) StdoutNullDelimitedLines() ( iter.Seq[string], func() error, )
Returns a single-use iterator over the output from git log.
Lines are split on NULLs with some additional processing.
func (Subprocess) StdoutText ¶
func (s Subprocess) StdoutText() (string, error)
func (Subprocess) Wait ¶
func (s Subprocess) Wait() error
type SubprocessErr ¶
func (*SubprocessErr) Error ¶
func (err *SubprocessErr) Error() string
func (*SubprocessErr) Unwrap ¶
func (err *SubprocessErr) Unwrap() error
Click to show internal directories.
Click to hide internal directories.