Repository navigation
Look into using difftastic for better diffs #57
Description
Activity
Possibly one immediate improvement would be to ignore whitespace changes? Might also need to do something like that for the (new) rev-check @alfsb
Although it has to do with revchecks, both
doc-baseandweb-doc, as they generate links, I think it can be initially developed exclusively inweb-doc, by extrincating diff capabilities fromhttps://doc.php.net/revcheck.phpinto a separateprettydiff.phpfile, and going from there. A diff page that does not contain headers and navbar for all languages, already helps.About whitespaces in diffs, I think this can be an option. The separated diff page may contain, for example, checkboxes for
Colored outputandIgnore whitespace, that if checked, causes the page to reload with new setup.Whitespace is always a PITA, because it is always important. While it is good to be able to observe only textual differences, having a way to observe WS changes has also its value. For example, the
pt_BRtranslation has a tool to trim right and sync left white space, on line basis, to automatize indentation syncing..Reacted by Gina Peter BanyardAbout specifically ignoring whitespace changes, it would be possible, but with caveats. Some internal whitespaces changes are important (for example, ws inside some tags that breaks automatic linking) and even changes that may or may not be synced in translations (for example) https://github.com/php/doc-en/pull/3837/files
But most or inter textual ws changes can be ignored. It's possible, for example, in the case of outdated files, to compare the contents of two versions of an en file, the last and the annotated in revtag, but trimming all lines and blank lines before comparison. If two "trimmed" files compare equals, there are no textual changes, and these files would not be marked outdated.
But it will slow, even more so as these cases of "line trim equals" accumulate. Some form of automatic hash bumping will be necessary after a while.
Reacted by Gina Peter BanyardWe're already using
--ignore-space-at-eolfor the diff, we could look at the other options the stockgit diffhas for ignoring whitespace changes.Maybe we could also use
--word-diff=plainor--word-diff=porcelainto show changed words instead of just lines.The descriptions of
--ignore-space-change/-boptions are a bit misleading. It will ignore ws changes on existing ws runs, but will report insertion or remotion of ws runs. This suffices for detecting significant ws changes and also ignoring insignificant ws changes in most cases that we are interested in.It will ignore ws changing within lines, and that's unfortunate.
An option like
--ignore-space-at-solexists only as patchs. Maybe exists a combination of-wand--word-diff-regex=, so that makes git consider one "word" any text between lines, with ws within but excluding ws after and before new lines, but neither my git or regex knowledge is high enough to create this regex.

As requested by @Girgias.
https://difftastic.wilfred.me.uk/