Implements the Git.Command behaviour for git interpret-trailers.
Adds or parses trailers in commit messages. Trailers are key-value pairs that appear at the end of a commit message, such as "Signed-off-by:" or "Co-authored-by:".
Summary
Functions
Returns the argument list for git interpret-trailers.
Parses the output of git interpret-trailers.
Types
Functions
Returns the argument list for git interpret-trailers.
Examples
iex> Git.Commands.InterpretTrailers.args(%Git.Commands.InterpretTrailers{})
["interpret-trailers"]
iex> Git.Commands.InterpretTrailers.args(%Git.Commands.InterpretTrailers{parse: true})
["interpret-trailers", "--only-trailers"]
iex> Git.Commands.InterpretTrailers.args(%Git.Commands.InterpretTrailers{trailers: ["Signed-off-by: A"]})
["interpret-trailers", "--trailer", "Signed-off-by: A"]
iex> Git.Commands.InterpretTrailers.args(%Git.Commands.InterpretTrailers{in_place: true, file: "msg.txt"})
["interpret-trailers", "--in-place", "msg.txt"]
iex> Git.Commands.InterpretTrailers.args(%Git.Commands.InterpretTrailers{where: "end"})
["interpret-trailers", "--where", "end"]
iex> Git.Commands.InterpretTrailers.args(%Git.Commands.InterpretTrailers{if_exists: "replace"})
["interpret-trailers", "--if-exists", "replace"]
iex> Git.Commands.InterpretTrailers.args(%Git.Commands.InterpretTrailers{if_missing: "doNothing"})
["interpret-trailers", "--if-missing", "doNothing"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, String.t()} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git interpret-trailers.
On success (exit code 0), returns {:ok, output} with the processed
message or trailer text. On failure, returns {:error, {stdout, exit_code}}.