Skip to content

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

Merged
joaomoreno merged 4 commits intomicrosoft:masterfrom
Mrigank11:master
Dec 20, 2018
Merged

Ask to add known huge folders to .gitignore, fixes #44304#44562
joaomoreno merged 4 commits intomicrosoft:masterfrom
Mrigank11:master

Conversation

@Mrigank11
Copy link
Contributor

fixes #44304

@msftclas
Copy link

msftclas commented Feb 27, 2018

CLA assistant check
All CLA requirements met.

@joaomoreno joaomoreno added this to the Backlog milestone Feb 28, 2018
@joaomoreno joaomoreno added the git GIT issues label Feb 28, 2018
Copy link
Member

@joaomoreno joaomoreno left a comment

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
Contributor Author

@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 joaomoreno closed this Sep 11, 2018
@joaomoreno joaomoreno reopened this Sep 11, 2018
@joaomoreno
Copy link
Member

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
Copy link
Contributor Author

Mrigank11 commented Sep 18, 2018

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 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