Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore package-lock.json #36

Closed
whyboris opened this issue Apr 18, 2018 · 5 comments
Closed

ignore package-lock.json #36

whyboris opened this issue Apr 18, 2018 · 5 comments

Comments

@whyboris
Copy link
Contributor

Problem

package-lock.json routinely has more than 2000 changes after npm install in a large project.

Solution

Simply exclude package-lock.json from showing up in the diff. Optionally give users an option to include it if this behavior is desired.

@rtfpessoa
Copy link
Owner

This project uses yarn so instead of npm install you should do yarn.

Still if you want to ignore that file feel free to send a PR.

@whyboris
Copy link
Contributor Author

whyboris commented Apr 18, 2018

Thank you for the quick response. Sorry if I've described the scenario poorly.

When using diff2thtml-cli on (for example) an Angular project where package.json was recently updated and npm install was run, diff2html-cli correctly shows the diff between the old and the updated package-lock.json files.

The problem arises that it's a large file with changes that are useless to (I assume pretty much) any developer. If it was collapsed by default in the HTML view that would be great (but that would require extra functionality to be added to the diff2html-cli & it would still slow down the experience - having to write and possibly render all the contents). The other option is that diff2html-cli simply ignores the file when creating the html diff view.

I am open to creating a PR to implement this feature (provided I find enough time and figure out how to do it). I certainly would want to confirm with you before working on this (fore me) time-consuming task that it would be a welcome improvement to the diff2html-cli rather than an unacceptable change.

Cheers!

@rtfpessoa
Copy link
Owner

Ok I think I got it.

I do not think removing any files by default it a good idea since some people might want to see them.

Still I can see two solutions for your problem. The quickest is excluding the files you want in the diff like this git diff -- . ':(exclude)package-lock.json' | diff2html -i stdin. The other would be like you described collapsing files with a lot of lines changed and that would be a nice feature.

If you think you would be willing to implement the second here are some ideas:

@alamothe
Copy link

It would be great to collapse huge files, and only load them on user click

diff2html can hang for minutes for files which are over 10k lines

@rtfpessoa
Copy link
Owner

Any PRs are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants