Skip to content

Temporary files (e.g. build products) lead to large diff #60

@KevinVlaanderen

Description

@KevinVlaanderen

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions