Closed riophae closed 8 years ago
Thanks for pointing out such an useful trick :clap: , I'm sure it will help a lot of people. In order not to confuse people who has got used to the current diff content, maybe we can add a button to enable this magic like this:
if you got a getter idea, glad to change.
A diff which may confuse people with this trick without a hint https://github.com/angular/angular.js/pull/10539/files?w=1
Well done! 👍 Blazing fast! Yes, indeed. In specific cases it would be very confusing.
I just came up with an alternative approach worth considering.
?w=1
will be added to any diff links automatically. The checkbox is unchecked as default, as users should be clear about the function before it being enabled.?w=1
automatically, then we can show a hint that why whitespace hiding is disabled.May be a bit opinionated... or just all my fantasy :D Thx for your patience!
Is there any consideration for this still? Having an option to default PR's to not showing whitespace diffs would be extremely useful, especially for those of us writing clojure and aligning maps values, as an example. We get diffs that are often 50% or more just whitespace and have been having to manually append the ?w=1 to our PR URLS.
Prepare to add this but don't get a time, PR is welcomed.
Finally this feature comes out. Will toggle between Show Spaces
and Ignore Spaces
like
Seems it's not applied to commit details page? I didn't see a "Ignore Spaces" button there.
Released v0.16.3 to fix this
I am not able to see this feature
Is this ever going to be available in Pull Requests?
@ArtS @amit133 fixed in v0.16.5
The w=1 trick is nice for viewing diffs, unfortunately you can't add comments for the Pull Request which is where this would be most useful.
Really annoying to not be able to see your actual change in a file that accidentally (or intentionally) got formatted as part of a commit, since changing the whitespace doesn't matter in most languages.
Are team would get alot of use from the menu/button option for selecting "no spaces" in diff when doing PRs. One common use-case for us is Jenkins often changes spaces/tabs to files automatically... which then leads to lots of file diff segments that are not "real" diffs. This button suggestion above would be great in the PR Files Changed tab/section.
Any time estimate for when this will finally make it? Hopefully ignoring spaces will not ignore leading white spaces in python?
Better to turn 'Hide Space' off in python code @phicharp
@camsong : we are moving a rather old project to using autopep8 and many spaces are removed (old style was with spaces after and before parentheses, around "=" etc...) and it is quite painful to see "real changes" if any, so hiding spaces is nice, but of course leading spaces are a problem...
@phicharp It's hard to support that. Right now, "hide space" is a feature supported by github, can not be modified.
OK, I understand this is not easy to implement, but AFAIS it is not exposed in the web interface, is it? I manage by adding "by hand" ?w=1
to the URL but this is not really nice
Just wanted to leave another vote to add a button to PR pages to do this. I learned of the trick using w=1, but wish there was a way to make that the default. I agree there are times when it should be flipped off, so having the button at the top of the page would be ideal.
Any chance of getting this promoted to a user pref setting that is applied automatically as the default state, then having the button to flip from there?
Thanks
@ericarnold-granular Will consider about this
Agree, this should be default. Or at least a toggle option. Please make it happen 👍
I love the checkbox that's been added for Hide Whitespace Changes. Can we add an option to make it the default?
@nadim I search and I didn't find the checkbox on a page with code changes, I have to add w=1 by hand ... Where can I find it please ?
@nicolas-albert
@nadim oops, I haven't seen that the report was for a Chrome extension :-Z I have installed it now 👍 Thx !
What chrome extension?
I'm pretty sure this is default github behaviour. No extension required.
On this kind of page, there is no button by default : https://github.com/nicolas-albert/c8o_yaml_projects/commit/bb851e57ae0a242b46bedb5bb25cb95ba3c173db?w=1
I have installed Octo Mate to have the Ignore / Show Spaces button.
@nadim do you know if that checkbox selection can be persisted? I find myself selecting it and then the page is reloaded, the selection is gone.
+1 for a persistent toggle - thank you!
Is it supported to persist the setting across PRs?
+1 for persistency, I want it to be saved as my user preference, so I will not have to enable it for each PR I am reviewing
+1 for persistent
+1 for persistency. Found this in the short term: https://chrome.google.com/webstore/detail/github-whitespace/fnpkdafamnbjoldglihkjjdicofghccm/related?hl=en-US
How about adding
?w=1
to any diff URLs automatically as optional? Personally speaking it's pretty useful, as I hardly ever care about any changes only in whitespace.