pub struct DiffFindOptions { /* private fields */ }
Expand description

Control behavior of rename and copy detection

Implementations

Creates a new set of empty diff find options.

All flags and other options are defaulted to false or their otherwise zero equivalents.

Reset all flags back to their unset state, indicating that diff.renames should be used instead. This is overridden once any flag is set.

Look for renames?

Consider old side of modified for renames?

Look for copies?

Consider unmodified as copy sources?

For this to work correctly, use include_unmodified when the initial diff is being generated.

Mark significant rewrites for split.

Actually split large rewrites into delete/add pairs

Find renames/copies for untracked items in working directory.

For this to work correctly use the include_untracked option when the initial diff is being generated.

Turn on all finding features.

Measure similarity ignoring leading whitespace (default)

Measure similarity ignoring all whitespace

Measure similarity including all data

Measure similarity only by comparing SHAs (fast and cheap)

Do not break rewrites unless they contribute to a rename.

Normally, break_rewrites and rewrites will measure the self-similarity of modified files and split the ones that have changed a lot into a delete/add pair. Then the sides of that pair will be considered candidates for rename and copy detection

If you add this flag in and the split pair is not used for an actual rename or copy, then the modified record will be restored to a regular modified record instead of being split.

Remove any unmodified deltas after find_similar is done.

Using copies_from_unmodified to emulate the --find-copies-harder behavior requires building a diff with the include_unmodified flag. If you do not want unmodified records in the final result, pas this flag to have them removed.

Similarity to consider a file renamed (default 50)

Similarity of modified to be eligible rename source (default 50)

Similarity to consider a file copy (default 50)

Similarity to split modify into delete/add pair (default 60)

Maximum similarity sources to examine for a file (somewhat like git-diff’s -l option or diff.renameLimit config)

Defaults to 200

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.