You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although it has to do with revchecks, both doc-base and web-doc, as they generate links, I think it can be initially developed exclusively in web-doc, by extrincating diff capabilities from https://doc.php.net/revcheck.php into a separate prettydiff.php file, 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 output and Ignore 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_BR translation has a tool to trim right and sync left white space, on line basis, to automatize indentation syncing..
About 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.
The descriptions of --ignore-space-change/-b options 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-sol exists only as patchs. Maybe exists a combination of -w and --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.
Activity
Girgias commentedon Nov 9, 2024
Possibly one immediate improvement would be to ignore whitespace changes? Might also need to do something like that for the (new) rev-check @alfsb
alfsb commentedon Nov 9, 2024
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..alfsb commentedon Nov 9, 2024
About 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.
jimwins commentedon Nov 9, 2024
We'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.alfsb commentedon Nov 9, 2024
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.alfsb commentedon Nov 10, 2024
git diff -bdoes a good job for (almost) all cases. I may implement some "only prefix/suffix" ws change on revcheck, to ignore some cases with it.It also would be an inicial alternative for while, or if difftastic is not possible.