hercules-ci/gitignore.nix

File being ignored even though it's committed

Opened this issue · 2 comments

If you have a git repository that contains a file that is committed but matches a .gitignore rule, it will be checked out by git but not by gitignore.nix.

Example repository:

git init test
cd test
mkdir dir
touch dir/file
git add dir/file
git commit -m test
echo 'dir/*' > .gitignore
git add .gitignore
git commit -m test2

If you clone this repository with git, dir/file will be checked out inside the cloned repo.

However, if you use gitignore.nix, it will filter dir/file, thus resulting in what appears to be an empty repository...

Ah, I see this might already be mentioned as missing functionality in the README file, specifically in the table with the row "Includes added but ignored files" (although I think "added" is not exactly the same as "committed" AFAIU).

Anyway, feel free to close this issue if you'd like.

It's a valid issue, and I think it should be resolved when Nix provides a sufficiently lazy fetching functionality, such as an alternative to. Not really blocked on the literal issue, but I'll link it as

More specifically it needs a non-experimental and lazy fetchTree for type = "git"; (mentioned in aforementioned issue).
Related milestone: