pub struct Driver {
pub name: BString,
pub command: Option<BString>,
pub algorithm: Option<Algorithm>,
pub binary_to_text_command: Option<BString>,
pub is_binary: Option<bool>,
}
blob
only.Expand description
A set of values to define how to diff something that is associated with it using git-attributes
, relevant for regular files.
Some values are related to diffing, some are related to conversions.
Fields§
§name: BString
The name of the driver, as referred to by [diff "name"]
in the git configuration.
command: Option<BString>
The command to execute to perform the diff entirely like <command> old-file old-hex old-mode new-file new-hex new-mode
.
Please note that we don’t make this call ourselves, but use it to determine that we should not run the our standard built-in algorithm but bail instead as the output of such a program isn’t standardized.
algorithm: Option<Algorithm>
The per-driver algorithm to use.
binary_to_text_command: Option<BString>
The external filter program to call like <binary_to_text_command> /path/to/blob
which outputs a textual version of the provided
binary file.
Note that it’s invoked with a shell if arguments are given.
Further, if present, it will always be executed, whether is_binary
is set or not.
is_binary: Option<bool>
Some(true)
if this driver deals with binary files, which means that a binary_to_text_command
should be used to convert binary
into a textual representation.
Without such a command, anything that is considered binary is not diffed, but only the size of its data is made available.
If Some(false)
, it won’t be considered binary, and the its data will not be sampled for the null-byte either.
Leaving it to None
means binary detection is automatic, and is based on the presence of the 0
byte in the first 8kB of the buffer.