nix-diff-1.0.20: Explain why two Nix derivations differ
Safe HaskellSafe-Inferred
LanguageHaskell2010

Nix.Diff.Transformations

Contents

Synopsis

Documentation

foldAlreadyComparedSubTrees :: DerivationDiff -> DerivationDiff Source #

In large diffs there may be a lot of derivations that doesn't change at all, but changed some of its nested inputs, that was already compared. This case will produce "stairs" of useless reports: ``` • The input derivation named a differs - nixstore/j1jmbxd74kzianaywml2nw1ja31a00r5-a.drv:{out} + nixstore/ww51c2dha7m5l5qjzh2rblicsamkrh62-a.drv:{out} • The input derivation named b differs - nixstore/j1jmbxd74kzianaywml2nw1ja31a00r5-b.drv:{out} + nixstore/ww51c2dha7m5l5qjzh2rblicsamkrh62-b.drv:{out} • The input derivation named c differs • These two derivations have already been compared ``` This transformation will fold all these subtrees of diff into one OnlyAlreadComparedBelow.

squashSourcesAndEnvsDiff :: DerivationDiff -> DerivationDiff Source #

This transformation is most useful for --json output, because it will sqash a lot of `{"content":" ","type":Both},{"content":When,"type":Both},{"content":" ","type":Both},{"content":"in","type":Both},{"content":" ","type":Both}` into one `{"content":" When in ","type":Both}` block.

To understand this problem clearer, see `golden-testsexpected-outputsjson` and `golden-testsexpected-outputsjson-squashed`.

_Warning_: this transformation can break some parts of printing in human readable mode.

Helpers