4379: File or section-based "force diff as new code" option.


What version are you running?


What's the URL of the page this enhancement relates to, if any?

diff viewer

Describe the enhancement and the motivation for it.

When someone completely rewrites the logic for a function, it often ends up as a bunch of red/green/yellow/white lines interspersed, and it can be very hard to read. There have been many times where I end up having to just download the new version and read it in a text editor to even be able to parse it reasonably well. Then I have no syntax highlighting, or if I load it into my IDE, I have "compilation issues" indicators 'cause it's not where it belongs in the project, etc., and it's hard to comment on it since I'm outside of RB. I'd love to see an option to just say "this is not actually a direct diff, they are rewriting it to new logic that is unrelated to the old logic, please show the old implementation as a giant red section and the new one as a giant green section so I can stay sane." This could be a file-level toggle checkbox or maybe a smart detection option. I dunno. But it's a thing me and my people often discuss and view as a flaw in the diff viewer.

What operating system are you using? What browser?


Please provide any additional information below.

#1 darrenmoffat

I'll second that. Even when the changes aren't large there are times when a far better review will be provided if you look only at the new code rather than the changes.
My preference would be for it to always be available via a toggle rather than any auto-detection mechanism.

We have the new file easily viewable using our current webrev tool, an example can be seen here: https://ips.java.net/webrev/barts/21868331/