Convert a lock with lots of info to something more readable
For instance:
[[package]]
name = "foo"
version = "1.4"becomes:
foo (1.4)
The primary purpose of this tool is to hide "noise" related to package changes
in automatically generated files such as Cargo.lock when using with git diff
and related commands.
For this to work, you need to register the 'lockdiff' as a text converter
in your git config (usually ~/.config/git/config)
[diff "lockdiff"]
textconv = lockdiffand then tell git to use lockdiff when diffing files, in ~/.config/git/attributes:
Cargo.lock diff=lockdiff
Note: in case of requirements.txt, you may want to put the config in .git/info/attributes
because sometimes the requirements.txt is maintained by hand and not generated by a tool like pip-compile.
Cargo.lockGemfile.lockcomposer.lockgo.sumpackage-lock.jsonpoetry.lockpubspec.lockshard.lockyarn.lockrequirements.txtand similar (the file name must containrequirementsand end with.txt, like indev-requirements.txt)