hercules-ci / gitignore.nix

Nix functions for filtering local git sources
The Unlicense
242 stars 19 forks source link

Ignore negation works differently than it Git #69

Open alerque opened 2 months ago

alerque commented 2 months ago

I just struggled with a Flake for a while and finally figured out some sources were being excluded from the Flake because ignore rules were being handled differently than Git itself does.

!scripts/*.in
scripts/*

In Git, this will result in all the autoconf template files ending with .in being tracked and everything else in the scripts directory (the AC_CONFIG_FILE output in my case) ignored. With gitignoreSource the order of operations is different and everything is getting ignored.

roberth commented 2 months ago

It seems that only the opposite order is tested: https://github.com/hercules-ci/gitignore.nix/blob/637db329424fd7e46cf4185293b9cc8c88c95394/tests/testdata.nix#L84-L89