Reputation: 25
I could use some help figuring out what's wrong with diff in a repo. I made two relatively simple changes, one was simply deleting an @media rule in a .css file, easily seen here in this commit's diff: https://github.com/TryGhost/Casper/commit/b12f5206eb5c63bd7faeed8a5c38089518a38695
That looks completely fine and reasonable, each selector matches up nicely in diff.
When I fix the formatting and unindent the selectors, again, diff looks great, each line matches up with its corresponding selector nicely:
https://github.com/TryGhost/Casper/commit/73c0befea23d6299e28280cc07b78d9da99c1c29
But, when I diff the overall branch with just those two commits, this is where everything goes off the rails with diff:
I can no longer do a nice side-by-side comparison of changes.
Any idea why this is happening and how I can fix it? I anticipate that the upstream repo this is forked from will change fairly often so I want to get things right going forward.
Thank you for your help in advance!
Upvotes: 1
Views: 347
Reputation: 113
You changed the indentations in the second commit. Githubs default view doesn't like this. Try the w=1 parameter. E.g. https://github.com/Torqu3Wr3nch/nightCasper/compare/master...Torqu3Wr3nch:darkTheme?diff=split&expand=1&w=1
Some further reading: https://github.blog/2018-05-01-ignore-white-space-in-code-review/
When reviewing code, a diff with a number of trivial white space changes can create enough noise that it’s difficult to focus on code changes.
Upvotes: 2
Reputation: 2836
your editor did an autoformat, which switched tabs with spaces.
note: some tools ignore whitespaces when showing diffs.
Upvotes: 0