Commit Graph

11 Commits

Author SHA1 Message Date
Philip Taron
997e54a4fb Avoid top-level with ...; in pkgs/build-support/nix-gitignore/default.nix
We also renamed `filter` (as a name of a parameter) to `predicate` following the naming suggestion in code review. It's better!

Since it's not part of an attrset, the name can change with no impact to semantics, since it can't be observed with `builtins.functionArgs`.

```
$ nix-repl
Nix 2.21.0
Type :? for help.
nix-repl> f = x: y: z: (x + y + z)

nix-repl> builtins.functionArgs f
{ }

nix-repl> :doc builtins.functionArgs
Synopsis: builtins.functionArgs f

    Return a set containing the names of the formal arguments expected by the function f. The value of each attribute is a Boolean denoting whether the corresponding argument has a default value. For instance, functionArgs ({ x, y ?
    123}: ...) = { x = false; y = true; }.

    "Formal argument" here refers to the attributes pattern-matched by the function. Plain lambdas are not included, e.g. functionArgs (x: ...) = { }.
```
2024-03-19 22:31:19 +01:00
Felix Bühler
0a2745684e
Merge pull request #239624 from Stunkymonkey/use-optionalString-then
treewide: use optionalString instead of 'then ""'
2023-07-22 13:02:47 +02:00
Felix Buehler
bec27fabee treewide: use lib.optional instead of 'then []' 2023-07-12 09:36:28 +01:00
Felix Buehler
f3719756b5 treewide: use optionalString instead of 'then ""' 2023-06-24 20:19:19 +02:00
Alyssa Ross
da450f6b1d treewide: clean up obsolete version checks
These checks are all redundant with the check for Nix ≥2.2 in
default.nix.
2022-03-22 10:54:11 +00:00
Guillaume Girol
f98bc23805
nix-gitignore: fix evaluation when .gitignore contains \# or \! (#130643) 2021-07-22 12:18:10 -04:00
Kevin Cox
11e522cb6e
Revert "nix-gitignore: Optimise performance" 2020-12-27 08:04:16 -05:00
Guillaume Girol
4eb94d0ca1
Merge pull request #94960 from symphorien/gitignore
nix-gitignore: filter-out .git
2020-12-10 20:34:54 +00:00
adisbladis
ef3ed45c12
nix-gitignore: Optimise performance
There are a few operations in this library that naively runs on every
iteration while they could be cached.

For a simple test repository with a small number of files and ~1000
gitignore patterns this brings memory usage down from ~233M to ~157M
and wall time from 2.6s down to 0.78s.

This should scale similarly with the number of files in a repository.
2020-12-07 14:14:20 +01:00
Symphorien Gibol
a5a383a389 nix-gitignore: filter-out .git 2020-10-21 12:00:00 +00:00
Raitis Veinbahs
d8a7a01fec nix-gitignore: init at v3.0.0 (#46112)
closes siers/nix-gitignore#6
2019-02-18 09:57:30 +00:00