-
Notifications
You must be signed in to change notification settings - Fork 20
Description
When a long string differs between derivations - usually some long shell script written in a multi-line string - nix-diff
prints the entire string contents, even if only a few lines of that long string have changed.
It would be nice if the parts in common were elided, like diff
does with files.
I've reproduced this in a gist to illustrate: https://gist.github.com/evanrelf/2b1b1772c5f83ca102c89d29e4839aa3
I have two derivations that write similar (long) shell scripts using writeShellScript
. Only one line is different between the Nix source code and the resulting shell scripts.
diff -u a.nix b.nix
and diff -u $(nix-build a.nix) $(nix-build b.nix)
are both very short; they elide parts in common.
nix-diff $(nix-instantiate a.nix) $(nix-instantiate b.nix)
prints the whole string.