upgrade-helper icon indicating copy to clipboard operation
upgrade-helper copied to clipboard

Show/Hide whitespace changes

Open slavikdenis opened this issue 6 years ago • 9 comments

It would be great if there would be an option to show / hide whitespace changes, so there would be less changes, see:

image

I think these kind of changes could be ignored and the upgrade process would be more clean.

Not sure if I described the idea well so feel free to ask more questions. Thanks

EDIT: link for the screenshot https://react-native-community.github.io/upgrade-helper/?from=0.60.5&to=0.61.1

slavikdenis avatar Sep 25 '19 13:09 slavikdenis

Hi @slavikdenis, thank you for the suggestion!

So, just for me to grasp the idea, do you mean that it should not highlight the whitespaces or it shouldn't show the diff at all if they contain only indentation changes?

lucasbento avatar Sep 26 '19 08:09 lucasbento

this is technically possible but I don't think we should add this.

you might not see that change but it's still a change. 'git apply' will see it if you use that.

what should happen here if you don't care about this change, is to skip it, mark it as done on the helper and move on to the next file. 👍

pvinis avatar Sep 26 '19 08:09 pvinis

Probably shouldn't show the diff at all. Do you think it's a bad idea? I'm kinda just used to use this feature in our companies gitlab.

slavikdenis avatar Sep 26 '19 08:09 slavikdenis

@pvinis I did not suggest to force it, but to have an option to 'Show' (default) or 'Hide' whitespace changes. So nothing really changes for the users.

slavikdenis avatar Sep 26 '19 08:09 slavikdenis

yesterday we added a little option popup which could be reused. if you are open to make a PR, that would be good. my guess is that this probably is an option already in the diff lib we use.

pvinis avatar Sep 26 '19 08:09 pvinis

Unfortunately react-diff-view doesn't seem to have support for it and I honestly don't think we should that on our own, should be done on the library itself.

@slavikdenis: can you please create an issue there as well to support hiding those spaces?

lucasbento avatar Sep 26 '19 08:09 lucasbento

https://github.com/otakustay/react-diff-view/issues/65

slavikdenis avatar Sep 26 '19 08:09 slavikdenis

Thanks @slavikdenis 🙌

lucasbento avatar Sep 26 '19 08:09 lucasbento

Based on https://github.com/otakustay/react-diff-view/issues/65#issuecomment-535414888, it's seems like, it still would have been needed to implement on the upgrade-helpers side. I might look into to that and let you know guys. Thanks so far

slavikdenis avatar Sep 26 '19 18:09 slavikdenis