if you change this file:
div
{
max-width: 50%;
max-height: 50%;
}
into this:
div
{
max-width: 100%;
}
git diff --word-diff will print:
div
{
max-width: [-50%;-]
[- max-height: 50%;-]{+100%;+}
}
wdiff:
div
{
max-width: [-50%;-]
[- max-height: 50%;-] {+100%;+}
}
this is confusing / unreadable
yes, diff correctly shows the easiest way of getting resulting one line from original 2 lines, but change becomes non-semantic
what i want is:
div
{
max-width: [-50%-]{+100%+};
[- max-height: 50%;-]
}
i.e. 1) line 2 changed; 2) line 3 removed
of course, diff doesn't know the semantics, but we do know that in vast majority of source code all partial modifications of lines are individual per line, even if they are tied together
so i want to tell diff to regard every line separately when showing the changes
option --avoid-wraps of wdiff does not achieve this
option --word-diff-regex of git diff won't help either - it tells git what to treat as a word - i.e. an atomic thing that it should not try to modify to change into a different word in the other file - but it does not stop git from grouping added/removed words together - representing them as a single change, including when they are on different lines - i.e. have a newline character between them
is there a way to force any of these programs to always show changes on different lines separately, or is there a diff program that has such an option?