Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

WIP: Improves gitignore performance & adds (future) option for force-commit of gitignored files #446

Closed
wants to merge 3 commits into from

Conversation

osklyar
Copy link

@osklyar osklyar commented Jun 20, 2017

This PR contains #444 and builds upon it.

Changed to WIP: testing on a collection of large repositories with nested .gitignore some inconsistencies have been identified

The problem: having gitignore matcher acting in the worktree on the diffs results in traversing over potentially massive trees of file names of directories which are fully excluded (think e.g. of a vendor/ gitignore record for Go modules). This is noticeably slow.

Solution: Unless forcing an ignored file into the commit, one could exclude these files at the file system level in the noder (as originally suggested), so the noder would not dive into the directory at all and save uncovering and then removing thousands of files. This PR combines the two approaches: if force disabled, then files are ignored at the file system level, if force is enabled, file system delivers the full tree and files are ignored in the diff, however those marked M or D in the worktree are forced through, along with all in staging. The point here was not to implement the force, but to speed up the normal case, and force comes as an added value, albeit not integrated into Status or Commit. Currently it is just a var flag set to false and only reset to true in the test to demo that force would work this way if added to Status and Commit.

@osklyar osklyar changed the title Improves gitignore performance & adds (future) option for force-commit of gitignored files WIP: Improves gitignore performance & adds (future) option for force-commit of gitignored files Jun 21, 2017
@osklyar
Copy link
Author

osklyar commented Jun 26, 2017

Won't fix now, maybe later

@osklyar osklyar closed this Jun 26, 2017
@osklyar osklyar deleted the gitignore-speed branch June 26, 2017 18:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant