Uh oh!
There was an error while loading. Please reload this page.
Keep the ignored files during the upgrade process - #17393
Conversation
@facebook-github-bot label iOS @facebook-github-bot label Core Team Generated by 🚫 dangerJS |
There was a problem hiding this comment.
copyCurrentGitIgnoreFile is not async so no need to use await here.
janicduplessis
commented
Jan 1, 2018
Actually I can just fix it myself :) @facebook-github-bot shipit |
facebook-github-bot
commented
Jan 1, 2018
Something went wrong when importing this pull request. Please cc someone from the team at fb to help with importing this. |
janicduplessis
commented
Jan 1, 2018
cc @hramos |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
hramos
left a comment
There was a problem hiding this comment.
Will need to rebase before we can import again.
When the user adds new files to the .gitignore file, those files are deleted during the upgrade process because it starts by creating a fresh .gitignore file without user's modification. This commit adds a step to move the excluded file at the repository level so that they are kept ignored during the upgrade process.
e474cad to
ffdfcebComparencuillery
commented
Jan 31, 2018
Rebase done @hramos |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Motivation
This PR fixes the issue #12237 relative to react-native-git-upgrade.
When the user adds new files to the .gitignore file, those files are deleted during the upgrade process because it starts by creating a fresh .gitignore file without user's modification, so the user's ignored files are no longer ignored and they are deleted during the upgrading process.
The best solution I've found to keep the user's ignored files... ignored, consists in appending the content of the .gitignore file in the
<TEMP DIR>/.git-rn/info/excludefile.The user's ignored files are now ignored at the repository level, they no longer interfere with the upgrade process.
Reminder: The tool uses a temporary local Git repository generated on the fly, so we can do whatever we want in it.
Test Plan
npm install -g react-native-git-upgradereact-native init MyApp --version=0.50.0dummy-ignored-file.jsonin the project's rootdummy-ignored-file.jsonto the.gitignorefilereact-native-git-upgrade👉 The
dummy-ignored-file.jsonis not deleted.Release Notes
[CLI][BUGFIX][react-native-git-upgrade] - Keep the user's ignored files while upgrading