openSUSE / open-build-service

Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
https://openbuildservice.org
GNU General Public License v2.0
939 stars 441 forks source link

Colorized diffs inside patches on request review page #13919

Open luc14n0 opened 1 year ago

luc14n0 commented 1 year ago

Whenever I review a request that adds/modifies patches I have to squint so my brain can find the diffs and try to make sense of what's going inside them. I think many reviewers would also agree.

Having a colorized diff inside patches would be a nice quality of life improvement for reviewers.

Something like this:

image

hellcp-work commented 1 year ago

This is essentially syntax highlighting inside of diffs, and while it may be easy to implement in case of diffs inside diffs, it's much harder in case of files where contents of previous lines influence how the following lines will be highlighted. We could fetch the original and modified files and highlight those, and that would work fine, but with that approach it will be easy to introduce performance issues. There's also no syntax highlighting for rpm spec or rpm changes inside of coderay or pretty much any other highlighter, so we would need to work on that as well.

luc14n0 commented 1 year ago

I honestly had only patches in mind when I thought about opening this feature request. And yeah, I can see how things could get complicated fast if we use syntax highlight for some other files.