-
-
Notifications
You must be signed in to change notification settings - Fork 313
Closed
Description
We are using patch-package to patch react-native. Unfortunately, compiling react-native results in Android/iOS build files within the node_modules folder. This leads to two problems:
- If no exclude option is provided,
npx patch-package react-nativeresults in a huge diff file, because all build files are seen as new and therefore added to the diff. - When adding the exclude option to ignore all build files, a new process is spawned to git reset each of them. This takes longer than we were willing to wait.
When debugging this, we noticed that the approach to creating a diff contains some inefficiencies:
- The diff command is ran twice; once to determine files to exclude, and once to obtain the final diff.
- Excluded files are only removed from the set very late (prior to creating the final diff. This means unnecessary copying of files.
- Excluded files are reset one per one. For every excluded file, a new 'git reset' process is spawned. This is very expensive. (see below)
I am working on a MR.
Metadata
Metadata
Assignees
Labels
No labels