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
Currently, one of the hardest diffs to review, is when a bunch of code gets indented positively or negatively. It's hard to tell if the user actually made a change somewhere in the indent code because it all mostly looks the same.
Reacted by Shahar "Dawn" Or, Ilya, Stargator, Daniel Kawalsky, Varun Singh, Dylan Reichstadt, sjwl, JJCUBER, Michael Engelhard, Sebastian Zander and 10 more
Wow. Completely am. That seems weird that it's a mostly hidden feature. It seems like it should be first-class. I don't think anyone benefits from seeing just tabbing changes.
Well there's a huge disadvantage with this method.
You cannot comment on lines in PRs.
I mean, that's clear, because for people who don't add ?w=1, the diff might look different. But wouldn't a sufficient solution be to let the user decide which default diff representation is set?
In some (most) programming languages, the indent doesn't matter at all functionality wise. It would be cool to be able to set the default view (with or without whitespace diff) for a repo
@mrdoob, There is a tickbox now to ignore whitespace on PR and commit diff pages (still missing on gist.github.com). @blainekasten, the real problem is not the indentation per se, but the fact that Github's diff viewer doesn't try very hard to align the lines - it only looks for identical lines to align the blocks, and then pads the smaller block with empty lines at the bottom. It doesn't try to align not-quite-identical lines. The only exception is made for the white space, but it is a manual option and it is quite blunt too as it ignores all whitespace regardless of how good the matching is overall.
What is required is a more flexible, fuzzy line alignment algorithm in general, which would try harder to align less than ideally matching lines and take into account how that affects matching of the nearby lines as well.
Reacted by mrdoob, Tim Phillips, Varun Singh, Kenichi Ebinuma, Jesse Smith and Adrian Setyadi
Reacted by Varun Singh, Dilip Kushwaha, Doeke de Wolf and Adi-L
Activity
mrdoob commentedon Jan 19, 2016
?w=1may be what you're after... https://github.com/blog/967-github-secretsblainekasten commentedon Jan 19, 2016
Wow. Completely am. That seems weird that it's a mostly hidden feature. It seems like it should be first-class. I don't think anyone benefits from seeing just tabbing changes.
mrdoob commentedon Jan 19, 2016
I agree, they should really add a switch in the UI somewhere for this.
Stargator commentedon Jan 19, 2016
👍
jawshooah commentedon Feb 15, 2016
In the meantime, there is a Chrome extension that adds a button for you.
danielbartsch commentedon Mar 8, 2018
Well there's a huge disadvantage with this method.
You cannot comment on lines in PRs.
I mean, that's clear, because for people who don't add
?w=1, the diff might look different. But wouldn't a sufficient solution be to let the user decide which default diff representation is set?In some (most) programming languages, the indent doesn't matter at all functionality wise. It would be cool to be able to set the default view (with or without whitespace diff) for a repo
il--ya commentedon Dec 1, 2018
@mrdoob, There is a tickbox now to ignore whitespace on PR and commit diff pages (still missing on gist.github.com).

@blainekasten, the real problem is not the indentation per se, but the fact that Github's diff viewer doesn't try very hard to align the lines - it only looks for identical lines to align the blocks, and then pads the smaller block with empty lines at the bottom. It doesn't try to align not-quite-identical lines. The only exception is made for the white space, but it is a manual option and it is quite blunt too as it ignores all whitespace regardless of how good the matching is overall.
What is required is a more flexible, fuzzy line alignment algorithm in general, which would try harder to align less than ideally matching lines and take into account how that affects matching of the nearby lines as well.
timotheecour commentedon Feb 24, 2020
I've made a PR that shows exactly the problem with all options I currently know of: see timotheecour/Nim#37
the actual diff contains a single large re-indented block; and a single re-indented line within that large block; none of the tools work well in this case:
git diff --color-moved-ws=allow-indentation-change --color-moved HEAD^or https://github.com/timotheecour/Nim/pull/37/files?w=1 all have significant drawbacks, as explained in that PRsophiebits commentedon Aug 8, 2022
For what it's worth, Reviewable handles @timotheecour's example well: