Implements the Git.Command behaviour for git cherry.
Finds commits in the current branch (or head) that have not yet been
applied to upstream. Each commit is marked with + (not applied) or
- (already applied upstream, i.e. an equivalent patch exists).
Summary
Types
Functions
Builds the argument list for git cherry.
Examples
iex> Git.Commands.Cherry.args(%Git.Commands.Cherry{upstream: "main"})
["cherry", "main"]
iex> Git.Commands.Cherry.args(%Git.Commands.Cherry{upstream: "main", verbose: true})
["cherry", "-v", "main"]
iex> Git.Commands.Cherry.args(%Git.Commands.Cherry{upstream: "main", head: "feature"})
["cherry", "main", "feature"]
iex> Git.Commands.Cherry.args(%Git.Commands.Cherry{upstream: "main", head: "feature", limit: "v1.0"})
["cherry", "main", "feature", "v1.0"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, [Git.CherryEntry.t()]} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git cherry.
Returns {:ok, [%Git.CherryEntry{}]} on success (exit code 0).
An empty output produces an empty list.