Open jlewi opened 1 year ago
Root issue is that go-git ignores .gitignore https://github.com/go-git/go-git/issues/597
We use the workaround suggested here https://github.com/go-git/go-git/issues/597#issuecomment-1301637889
Here's the code https://github.com/jlewi/hydros/blob/2034660a805aa8152a75a10f5edebb7502791799/pkg/gitutil/gitutil.go#L44
Which doesn't work with nested .gitingore
I think we could extend it to work with nested .gitignores as follows
We could probably simplify it as follows; in walking the directory to find .gitignore it would probably be sufficient to just ignore hidden directories (directories that start with "."). This way we wouldn't need logic to match directories against git exclude patterns (although I imagine there are functions in gogit or elsewhere we could use).
I have a project with the following directory tree
Here frontend is a flutter app. When hydros automatically commits all files. It ends up picking up files from frontend that should be ignored by frontend/.gitignore