Skip to main content
edited title
Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

What effect does the -d/-"-minimald" option have with diff?

edited title
Link
muru
  • 77.9k
  • 16
  • 212
  • 318

About "diff What effect does the -d"d/--minimal option have with diff?

bit flip
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264

The diff implementation on OpenBSD has a non-standard -d option with the following documentation:

-d

Try very hard to produce a diff as small as possible. This may consume a lot of processing power and memory when processing large files with many changes.

The GNU diff implementation has the same option with the shorter documentation

-d, --minimal

try hard to find a smaller set of changes

From time to time I've used this option just to see if it generates output that is in any shape or form different from the same diff command without the option, bitbut I've never seen any difference (no pun intended).

Could someone provide or point to an example where this option actually produces a different result from the same command without -d? Alternatively, if someone could explain the circumstances required for this option to kick in. I'm also uncertain whether "minimal" means "fewer lines of output" or "fewer hunks".

An uneducated guess is that it has to do with very large hunks.

The diff implementation on OpenBSD has a non-standard -d option with the following documentation:

-d

Try very hard to produce a diff as small as possible. This may consume a lot of processing power and memory when processing large files with many changes.

The GNU diff implementation has the same option with the shorter documentation

-d, --minimal

try hard to find a smaller set of changes

From time to time I've used this option just to see if it generates output that is in any shape or form different from the same diff command without the option, bit I've never seen any difference (no pun intended).

Could someone provide or point to an example where this option actually produces a different result from the same command without -d? Alternatively, if someone could explain the circumstances required for this option to kick in. I'm also uncertain whether "minimal" means "fewer lines of output" or "fewer hunks".

An uneducated guess is that it has to do with very large hunks.

The diff implementation on OpenBSD has a non-standard -d option with the following documentation:

-d

Try very hard to produce a diff as small as possible. This may consume a lot of processing power and memory when processing large files with many changes.

The GNU diff implementation has the same option with the shorter documentation

-d, --minimal

try hard to find a smaller set of changes

From time to time I've used this option just to see if it generates output that is in any shape or form different from the same diff command without the option, but I've never seen any difference (no pun intended).

Could someone provide or point to an example where this option actually produces a different result from the same command without -d? Alternatively, if someone could explain the circumstances required for this option to kick in. I'm also uncertain whether "minimal" means "fewer lines of output" or "fewer hunks".

An uneducated guess is that it has to do with very large hunks.

Tweeted twitter.com/StackUnix/status/1046822795060170752
added 85 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Loading
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Loading