Skip to content

Ask to add known huge folders to .gitignore, fixes #44304 - #44562

Merged
João Moreno (joaomoreno) merged 4 commits into
microsoft:masterfrom
Mrigank11:master
Dec 20, 2018
Merged

Ask to add known huge folders to .gitignore, fixes #44304#44562
João Moreno (joaomoreno) merged 4 commits into
microsoft:masterfrom
Mrigank11:master

Conversation

@Mrigank11

Copy link
Copy Markdown
Contributor

fixes #44304

@msftclas

Microsoft Contribution License Agreements (msftclas) commented Feb 27, 2018

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@joaomoreno João Moreno (joaomoreno) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot about this which is suboptimal. The user should know which folders would be added to gitignore. This doesn't check whether node_modules is already in gitignore at all. This should also be done before any large git status even runs; right now, the Repository will still get into a isRepositoryHuge = true state... the user would still have to reload to get out of it, even after adding to gitignore.

@Mrigank11

Copy link
Copy Markdown
Contributor Author

João Moreno (@joaomoreno) Thanks for the review. I tried to solve the issues you mentioned:

The user should know which folders would be added to gitignore.

done

This doesn't check whether node_modules is already in gitignore at all.

I used the existing checkIgnore method to do that.

This should also be done before any large git status even runs; right now, the Repository will still get into a isRepositoryHuge = true state... the user would still have to reload to get out of it, even after adding to gitignore.

This was solved by saving the .gitignore the in the ignore method because updateModelState was going to be called anyway. So, the repository will be rechecked.

@joaomoreno

Copy link
Copy Markdown
Contributor

This was solved by saving the .gitignore the in the ignore method because updateModelState was going to be called anyway. So, the repository will be rechecked.

This is not true. The repository will be in a isRepositoryHuge state, which force the user to reload the window. Give it a try.

@Mrigank11

Mrigank Krishan (Mrigank11) commented Sep 18, 2018

Copy link
Copy Markdown
Contributor Author

If the user presses 'Yes' to the prompt, .gitignore will be saved and updateModelState will be called, so the user won't have to reload the window as updateModelState will update the repo state i.e. isRepositoryHuge will be calculated again (#1).

So, the only case I'm missing is 'when the user modifies .gitignore manually' (right?). How about we use onFSChange to monitor .gitignore (only when isRepositoryHuge is true) and call updateModelState if it changes?

@joaomoreno
João Moreno (joaomoreno) merged commit d1ba7ad into microsoft:master Dec 20, 2018
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

git GIT issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git: Support to automatically add large folders to .gitignore

3 participants